Added validations and associations to user model.