Functional test
Added model validator and unit tests