Added groups, implemented the whole API