Server users api unit testing and improvements