added client side groups, sails api callback, refactoring