fixed model validation issues and query issues in addition to adding more tests for querying