@RequestMapping(
      value = "/getData",
      produces = {"image/png"},
      method = POST)
  public void getTimeseriesCollectionChart(
      HttpServletResponse response, @RequestBody DesignedParameterSet requestParameters)
      throws Exception {

    checkIfUnknownTimeseries(requestParameters.getTimeseries());

    IoParameters map = createFromQuery(requestParameters);
    UndesignedParameterSet parameters = createFromDesignedParameters(requestParameters);
    checkAgainstTimespanRestriction(parameters.getTimespan());
    parameters.setGeneralize(map.isGeneralize());
    parameters.setExpanded(map.isExpanded());
    parameters.setBase64(map.isBase64());

    String[] timeseriesIds = parameters.getTimeseries();
    TimeseriesMetadataOutput[] timeseriesMetadatas =
        timeseriesMetadataService.getParameters(timeseriesIds, map);
    RenderingContext context = createContextWith(requestParameters, timeseriesMetadatas);
    IoHandler renderer = IoFactory.createWith(map).createIOHandler(context);

    handleBinaryResponse(response, parameters, renderer);
  }
  @RequestMapping(
      value = "/getData",
      produces = {"application/json"},
      method = POST)
  public ModelAndView getTimeseriesCollectionData(
      HttpServletResponse response, @RequestBody UndesignedParameterSet parameters)
      throws Exception {

    checkIfUnknownTimeseries(parameters.getTimeseries());

    TvpDataCollection timeseriesData = getTimeseriesData(parameters);
    TimeseriesDataCollection<?> formattedDataCollection =
        format(timeseriesData, parameters.getFormat());
    return new ModelAndView().addObject(formattedDataCollection.getTimeseriesOutput());
  }