added model validations with tests