Remaped URLs from api/users/<username> to api/user and refactored code
Refactored server code