added validations and some model tests