Registeration API

Hi guys,
I’m working on a website and a mobile app for it. I’m trying to register a user from the mobile app, making him able to login later from the website.
I’m using post method and passing user info in json format. In my “http-functions.js” file I’m getting the data but register() method doesnt work. If assigning the method to a variable, I receive the following:
“result”: {
“isFulfilled”: false,
“isRejected”: false
}
}

I also tried to create a register method in “register.jsw” file and and import this method to “http-functions” file - also couldnt register a user.

my full code:
import wixUsers from ‘wix-users-backend’;
import {ok, notFound, serverError, badRequest} from ‘wix-http-functions’;
import wixData from ‘wix-data’;

export function post_registerUser (request) {
let options = {
“headers”: {
“Content-Type”: “application/json”
}
};

return request.body.json().then((body) => {
let newUser = body
let email = body[‘email’]
let password = body[‘[password’]
let firstName = body[‘firstName’]
let lastName = body[‘lastName’]

let result;

//Registering the user
result = wixUsers.register(email, password, {
“contactInfo”: {
“firstName”: firstName,
“lastName”: lastName
}
})
options.body = {
“newUser”: newUser,
“result”: result
};
return ok(options);

}). catch ( (error) => {
options.body = {
“error”: error,
};
return serverError(options);
} );
}

Thanks in advance!

https://www.wix.com/code/reference/wix-users-backend.html#register
https://www.wix.com/code/reference/wix-fetch.html#getJSON

Thanks but I’m already familiar with this documentation.
Still, I couldn’t get it to work.