public static Result restResourceUsageDataByUser(String startTime, String endTime) {
    try {
      JsonArray datasets = new JsonArray();
      if(startTime.length() != endTime.length() ||
          (startTime.length() != 10 && startTime.length() != 13)) {
        return status(300);
      }
      SimpleDateFormat tf = null ;
      if( startTime.length() == 10 ) {
         tf = new SimpleDateFormat("yyyy-MM-dd");
      }
      else {
        tf = new SimpleDateFormat("yyyy-MM-dd-HH");
      }
      Date start = tf.parse(startTime);
      Date end = tf.parse(endTime);
      Collection<AppResourceUsageData> result = getUserResourceUsage(start, end);

      return ok(new Gson().toJson(result));
    }
    catch(ParseException ex) {
      return status(300,"Invalid datetime format : " + ex.getMessage());
    }
  }
@param startTime - beginning of the time window
@param endTime - end of the time window
@return Json of resourceUsage data for each user for the given time window
   eg. [{"user":"bmr","resourceUsed":168030208,"resourceWasted":27262750},
       {"user":"payments","resourceUsed":18432,"resourceWasted":3447},
       {"user":"myu","resourceUsed":558211072,"resourceWasted":81573818}]
app/controllers/Application.java