HttpGet get = new HttpGet(String.format("https://jawbone.com/nudge/api/v.1.0/users/@me/moves?start_time=%s&updated_after=%s", beginningOfTime, "1391432752"));
get.setHeader("Authorization", "Bearer b6_3pfGGwEhBVmnMx7TBfdpj72FdmizX1SAGFutknc_gduJsmw0YrYmjV9_oVcGdLeXXdbUpUeld6BVfbotfEVECdgRlo_GULMgGZS0EumxrKbZFiOmnmAPChBPDZ5JP");
HttpResponse response = client.execute(get);
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == HttpStatus.SC_OK) {
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String content = responseHandler.handleResponse(response);
JSONObject json = JSONObject.fromObject(content);
JSONObject data = json.getJSONObject("data");
JSONArray items = data.getJSONArray("items");
for (int i=0; i<items.size(); i++) {
JSONObject item = items.getJSONObject(i);