The API call /api/2/rest/package/<id> returns the display name of the group instead of its ID. To properly match the group, munge the name before calling /api/2/rest/group