anchor.diff:  				ResId ->
   					ResAdded = add_field(UserAdded,"resource_id",ResId)
   			end,
  -			%display:erlang(ResAdded),
   			case erlastic_search:index_doc(?INDEX, "stream", ResAdded) of	
  -				{error, Reason} -> {{error, Reason}, ReqData, State};
  -				{ok,List} -> erlang:display(convert_binary_to_string(json_encode(List))), 
  -							 {convert_binary_to_string(json_encode(List)), ReqData, State}
  +				{error, Reason} -> {false, wrq:set_resp_body(json_encode(Reason),ReqData), State};
  +				{ok,List} -> erlang:display("Sucess"), 
  +							 {true, wrq:set_resp_body(json_encode(List),ReqData), State}
   			end;
   		true ->
   			process_search(ReqData,State)	
   	end.
  +
  +%% @doc
  +%% Function: process_search/2
  +%% Purpose: Used to handle search requests that come from POST or GET requests
  +%% Returns: {Sucess, ReqData, State}, where Sucess is true if the search request is 
  +%%          sucessful and false otherwise.
  +%% @end
  +-spec process_search(ReqData::term(),State::term()) -> {boolean(), term(), term()}.
   
   process_search(ReqData, State) ->
   	erlang:display("search request"),
  
positive.code: %% @end
  -spec init([]) -> {ok, undefined}.
  init([]) -> 
  	 %% start this in the make file somehow
      {ok, undefined}.
  
  %% @doc
  %% Function: allowed_methods/2
  %% Purpose: init function used to fetch path information from webmachine dispatcher.
  %% Returns: {ok, undefined}
  %% @end
  
  allowed_methods(ReqData, State) ->
  	erlang:display(parse_path(wrq:path(ReqData))),
  
negative.code: 	Update = create_update(Stream),
  	erlang:display(Update),
  	case erlastic_search:update_doc(?INDEX, "stream", StreamId, Update) of 
  		{error,Reason} -> {false, wrq:set_resp_body(json_encode(Reason),ReqData), State};
  		{ok,List} -> {true,wrq:set_resp_body(json_encode(List),ReqData),State}
  	end.
  
  
  
  
  
  %% @doc
  %% Function: get_stream/2
  %% Purpose: Used to handle GET requests by giveing the document with the given
  %%          Id or listing the documents that can be found from the restrictions
  %%          given by the URI.
  %% Returns: {Sucess, ReqData, State}, where Sucess is true if the PUT request is 
  %%          sucessful and false otherwise.
  %% @end
  -spec get_stream(ReqData::term(),State::term()) -> {boolean(), term(), term()}.
  
  get_stream(ReqData, State) ->
  	case is_search(ReqData) of
  