Add group membership api

Change-Id: I5b174bba02856ede788dcb51ec9b0d598ea7d0df
Fixes for @randx

Change-Id: I3b15ae34c0957a0f4026e1886c92a9770e9d170e
Merge pull request #4990 from karlhungus/feature_group_membership_api

Add group membership api