Put API schema into lib.
Refactored user model based on the API schema changes.