anchor.diff:      lib_json:set_attr(users, AddedPassword).
   
   %% @doc
  +%% Function: id_from_path/1
  +%% Purpose: Retrieves the id from the path.
  +%% Returns: Id
  +%% @end
  +-spec id_from_path(RD::tuple()) -> string().
  +id_from_path(RD) ->
  +    Fetch_user_id = fun(TableName, Id) ->
  +        case erlastic_search:get_doc(?INDEX, "stream", Id) of
  +            {error, _} -> undefined;
  +            {ok, JSON} ->
  +                UID = lib_json:get_field(JSON, "_source.user_id"),
  +                string:to_lower(binary_to_list(UID))
  +        end
  +    end,
  +
  +    case api_help:parse_path(wrq:path(RD)) of
  +        [error]               -> undefined;
  +        [{"users"}]           -> undefined;
  +        [{"users", Id}]       -> string:to_lower(Id);
  +        [{"users", Id}, _]    -> string:to_lower(Id);
  +        [{"streams", Id}]     -> Fetch_user_id("streams", Id);
  +        [{"streams", Id}, _]  -> Fetch_user_id("streams", Id);
  +        [{"vstreams", Id}]    -> Fetch_user_id("vstreams", Id);
  +        [{"vstreams", Id}, _] -> Fetch_user_id("vstreams", Id);
  +        _                     -> undefined
  +    end.
  +
  +%% @doc
   %% Function: is_polling_history/1
   %% Purpose: Used to deiced if the URI specify a polling_history
   %% Returns: True if URI specify a pollinghistory, false otherwise
  
positive.code: -module(api_help).
  -include_lib("erlastic_search.hrl").
  -include("json.hrl").
  
  -export([any_to_float/1,
  	 do_any_field_exist/2,
  
negative.code: 	 get_list_and_add_id/2,
  	 get_and_add_password/1,
  	 get_list_and_add_password/1,
  	 id_from_path/1,
  	 is_polling_history/1,
  	 is_auth/1,
  	 is_auth_redirect/1,
  