added manyToMany for categories
modified sync to handle categories