Add model validations and wrote test