try {
JSONObject jsonobject = getJSONFromRequest(finalURL);
JSONArray jarray = jsonobject.getJSONArray("realms");
jsonobject = jarray.getJSONObject(0);
Realm realm = new Realm();
realm.setName(jsonobject.getString("name"));
realm.setPopulation(jsonobject.getString("population"));
realm.setType(jsonobject.getString("type"));
realm.setSlug(jsonobject.getString("slug"));
realm.setStatus(jsonobject.getBoolean("status"));
realm.setQueue(jsonobject.getBoolean("queue"));
return realm;
} catch (Exception e) {
e.printStackTrace();
}