finished getgroups api functionality