Add validation to Model class