Guest guest = ApiHelper.getBuddyToAccess(guestService, coachee);
if (guest==null)
return Response.status(401).entity("You are no longer logged in").build();
long guestId = guest.getId();
List<DataUpdate> updates = dataUpdateService.getAllUpdatesSince(guestId, ISODateTimeFormat.dateTime().parseMillis(since));
return Response.ok(gson.toJson(new DataUpdateDigestModel(updates,guestService,settingsService,ISODateTimeFormat.dateTime().parseMillis(since)))).build();
}
catch (Exception e){
e.printStackTrace();
return Response.serverError().entity("Failed to fetch updates").build();
}