anchor.diff:  %% @end        
   -spec format_result({Mean::list(), Lo80::list(), Hi80::list(), Lo95::list(), Hi95::list()}) -> string().
   format_result({[HeadMean|[]], [HeadLo80|[]], [HeadHi80|[]],[HeadLo95|[]], [HeadHi95|[]]}) ->
  -        "{ \"value\":" ++ lists:flatten(io_lib:format("~p", [HeadMean])) ++
  -        ",\"lo80\":" ++ lists:flatten(io_lib:format("~p", [HeadLo80])) ++
  -        ",\"hi80\":" ++ lists:flatten(io_lib:format("~p", [HeadHi80])) ++
  -        ",\"lo95\":" ++ lists:flatten(io_lib:format("~p", [HeadLo95])) ++
  -        ",\"hi95\":" ++ lists:flatten(io_lib:format("~p", [HeadHi95])) ++ "}]}";
  +	"{ \"value\":" ++ lists:flatten(io_lib:format("~p", [HeadMean])) ++
  +		",\"lo80\":" ++ lists:flatten(io_lib:format("~p", [HeadLo80])) ++
  +		",\"hi80\":" ++ lists:flatten(io_lib:format("~p", [HeadHi80])) ++
  +		",\"lo95\":" ++ lists:flatten(io_lib:format("~p", [HeadLo95])) ++
  +		",\"hi95\":" ++ lists:flatten(io_lib:format("~p", [HeadHi95])) ++ "}]}";
   format_result({[HeadMean|Mean], [HeadLo80|Lo80], [HeadHi80|Hi80],[HeadLo95|Lo95], [HeadHi95|Hi95]}) ->
  -        "{ \"value\":" ++ lists:flatten(io_lib:format("~p", [HeadMean])) ++
  -        ",\"lo80\":" ++ lists:flatten(io_lib:format("~p", [HeadLo80])) ++
  -        ",\"hi80\":" ++ lists:flatten(io_lib:format("~p", [HeadHi80])) ++
  -        ",\"lo95\":" ++ lists:flatten(io_lib:format("~p", [HeadLo95])) ++
  -        ",\"hi95\":" ++ lists:flatten(io_lib:format("~p", [HeadHi95])) ++ "},"
  -         ++ format_result({Mean, Lo80, Hi80, Lo95, Hi95}).
  +	"{ \"value\":" ++ lists:flatten(io_lib:format("~p", [HeadMean])) ++
  +		",\"lo80\":" ++ lists:flatten(io_lib:format("~p", [HeadLo80])) ++
  +		",\"hi80\":" ++ lists:flatten(io_lib:format("~p", [HeadHi80])) ++
  +		",\"lo95\":" ++ lists:flatten(io_lib:format("~p", [HeadLo95])) ++
  +		",\"hi95\":" ++ lists:flatten(io_lib:format("~p", [HeadHi95])) ++ "},"
  +		++ format_result({Mean, Lo80, Hi80, Lo95, Hi95}).
   
   
   %% @doc
  
positive.code: 			end;
  		StreamId ->
  			NrValues = case wrq:get_qs_value("nr_values",ReqData) of
  						   undefined ->
  							   50;
  						   Values ->
  							   {Value,_} = string:to_integer(Values),
  							   Value 
  					   end,
  			NrPredictions = case wrq:get_qs_value("nr_preds",ReqData) of
  								undefined ->
  									"25";
  								Predictions ->
  									Predictions
  							end,
  			case erlastic_search:search_limit(?INDEX, "datapoint","stream_id:" ++ StreamId ++ "&sort=timestamp:desc", NrValues) of
  				%case erlastic_search:search_json(#erls_params{}, ?INDEX, "datapoint", create_json(StreamId), []) of
  
negative.code: %% @end
  -spec content_types_accepted(ReqData::tuple(), State::string()) -> {list(), tuple(), string()}.
  content_types_accepted(ReqData, State) ->
  	{[{"application/json", get_analysis}], ReqData, State}.
  
  %% @doc
  %% Function: get_analysis/2
  