fixed a bunch of user endpoints and added unit tests