anchor.diff:  		   {"query.filtered.filter.range.timestamp", "{}"},
   		   {"query.filtered.filter.range.timestamp.gte", TimestampFrom}
   	]),
  -	
  +
   	Interval = binary_to_list(lists:nth(2, Function)),
   	Facet = [{"facets", "{}"},
   			{"facets.statistics", "{}"},
  
positive.code: %% @end
  -spec delete_resource(ReqData::term(),State::term()) -> {boolean(), term(), term()}.
  delete_resource(ReqData, State) ->
  	case {proplists:get_value('id', wrq:path_info(ReqData))} of
  		{Id} ->
  			case streams:delete_data_points_with_stream_id(Id, "virtual_stream") of 
  				{error, {Code, Body}} -> 
  					ErrorString = api_help:generate_error(Body, Code),
  					{{halt, Code}, wrq:set_resp_body(ErrorString, ReqData), State};
  				{ok} ->
  					case erlastic_search:delete_doc(?INDEX,"virtual_stream", Id) of
  						{error, {Code, Body}} -> 
  							ErrorString = api_help:generate_error(Body, Code),
  							{{halt, Code}, wrq:set_resp_body(ErrorString, ReqData), State};
  						{ok,List} -> 
  							virtual_stream_process_supervisor:terminate_child(Id),
  							{true,wrq:set_resp_body(lib_json:encode(List),ReqData),State}
  					end
  			end
  	end.
  
  
  %% @doc
  
negative.code: 			{true, wrq:set_resp_body("\"status\":\"ok\"", ReqData), State}
  	end.
  
  
  %% @doc
  %% Function: get_vstream/2
  %% Purpose: Used to handle GET requests by giving the document with the given Id
  