Fixed bugs and added pagination for groups