anchor.diff:  
   -include_lib("webmachine/include/webmachine.hrl").
   -include("include/user.hrl").
  +
  +-define(INDEX, "sensorcloud").
   
   %% @doc
   %% Function: init/1
  
positive.code: 		false ->
  			erlang:display("update request"),
  			{Stream,_,_} = json_handler(ReqData,State),
  			case erlastic_search:index_doc("streams","stream",Stream) of
  				{error,Reason} -> {{error,Reason}, ReqData, State};
  				{ok,_List} -> {true,ReqData,State}
  			end;
  		true ->
  			erlang:display("search request"),
  			URIQuery = wrq:req_qs(ReqData),
  			case proplists:get_value('user', wrq:path_info(ReqData)) of
  				undefined ->
  					UserQuery = [];
  				UserId ->
  					UserQuery = ["q=owner_id:" ++ lists:nth(1,UserId)]
  			end,
  			case proplists:get_value('res', wrq:path_info(ReqData)) of
  				undefined ->
  					ResQuery = [];
  				ResId ->
  					ResQuery = ["q=resource_id:" ++ lists:nth(1,ResId)]
  			end,
  			SearchQuery = lists:append(URIQuery,lists:append(UserQuery,ResQuery)),
  			case erlastic_search:search_limit("streams", "stream", SearchQuery,100) of % Maybe wanna take more
  				{error,Reason} -> {{error,Reason}, ReqData, State};
  				{ok,List} -> {List,ReqData,State} % May need to convert
  			end
  
negative.code: 
  
  %% DELETE
  %% Works but need to fix transformation of the return value
  delete_resource(ReqData, State) ->
  	Id = proplists:get_value('stream', wrq:path_info(ReqData)),
  	erlang:display("delete request"),
  	erlang:display(Id),
  	case erlastic_search:delete_doc(?INDEX,"stream", Id) of
  			{error,Reason} -> {{error,Reason}, ReqData, State};
  			{ok,List} -> {json_encode(List),ReqData,State}
  	end.
  
  
  
  %% POST
  