code: @Override
      @Path("/{groupName}")
      @ApiOperation(value="Retrieve a workgroup or all workgroups",
          notes="If groupName is not present, returns all workgroups.",
          response=Workgroup.class, responseContainer="List")
      public JSONObject get(String path, Map<String,String> headers)
      throws ServiceException, JSONException {
          UserServices userServices = ServiceLocator.getUserServices();
          try {
              String groupName = getSegment(path, 1);
              if (groupName == null) // check parameter
                  groupName = getParameters(headers).get("name");
              if (groupName != null) {
                  Workgroup group = userServices.getWorkgroup(groupName);
                  if (group == null)
                      throw new ServiceException(ServiceException.NOT_FOUND, "Workgroup not found: " + groupName);
                  return group.getJson();
              }
              else {
                  return userServices.getWorkgroups().getJson();
              }
          }
          catch (ServiceException ex) {
              throw ex;
          }
          catch (Exception ex) {
              throw new ServiceException(ex.getMessage(), ex);
          }
      }
docs: Retrieve a workgroup or all workgroups.