Adding model tests for Category

Also fixed the category relationship