Model data validations

Adds model data validations and unit testing.