added some model validations and tests