The functions updateUser and replaceUser in the database.ts file (here) seems to point towards wrong urls:
...
path: `/api/user/${encodeURIComponent(username)}`,
...
instead of:
...
path: `/_api/user/${encodeURIComponent(username)}`,
...
(note the underscore in /_api)