class IMSController {

    @RequestMapping(value = "/api/chart", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity chart(@RequestBody IMSRequestQuery payload) throws JSONException
    {
        DayImpression result;
        try
        {
            result = inventoryEstimateService.getInventoryDateEstimate(payload.getTargetingChannel());
        }
        catch (Exception e)
        {
            LOGGER.error(e.getMessage());
            return ResponseBuilder.buildError(e);
        }
        return ResponseBuilder.build(result, HTTP_OK_CODE);
    }

}