created model tests and added validation code to make tests pass
tests