refactor dulicate codes in GroupResourceEndpoint and change null return values to empty array