added model validations and tests