Added unit testing for users and restructured auth API