The group API is very similar to the role API for accessing, searching and determining memberships of groups.