JSONArray groups = db.getJSONObject(GROUPS_TABLE).getJSONArray(user);
for (int i = 0; i < groups.length(); i++) {
JSONObject group = groups.getJSONObject(i);
Group groupObj = filterFields(group, fields, Group.class);
result.add(groupObj);
}
} catch (JSONException je) {
throw new ProtocolException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, je.getMessage(), je);
}