'id' isn't an attribute returned by the JSON response in groups_json.  Please confirm here and elsewhere that you are fetching the ids via the proper attributes.