anchor.diff:  %%           OK = {ok}
   %% @end
   -spec delete_streams_with_user_id(Id::string()) -> term().
  -
   delete_streams_with_user_id(Id) ->
       api_help:refresh(),
       Query = "user_id:" ++ Id,
  
positive.code: %% Returns:  a list with the ids of the JSON objects given
  %% @end
  -spec get_streams(JSON::string()) -> list().
  
  get_streams(JSON) when is_tuple(JSON)->
      Result = lib_json:get_field(JSON, "hits.hits"),
      get_streams(Result);
  
negative.code: 
                  {ok, UserData} ->
                      case user_is_new(UserData) of
                          false -> Status = replace_old_access_token(UserData, AccToken);
                          true  -> Status = store_user(UserData, AccToken, RefToken)
                      end,
  
                      case Status of
                          {error, Msg} -> {error, Msg};
                          {ok, _} ->
                              Struct = {struct, [
                                  {access_token, AccToken},
                                  {refresh_token, RefToken}
                              ]},
                              Res = mochijson2:encode(Struct),
                              {true, Res}
                      end
              end
      end.
  
  
  -spec replace_old_access_token(UserData::string(), AccToken::string()) -> true.
  replace_old_access_token(UserData, AccToken) ->
      case get_user_by_token("access_token", AccToken) of
          {error, Msg} -> {error, Msg};
          {ok, JSON} ->
              Username = lib_json:get_field(JSON, "username"),
              UserJSON = lib_json:replace_field(JSON, "access_token", AccToken),
              Update   = lib_json:set_attr(doc, UserJSON),
              case api_help:update_doc(?INDEX, "user", Username, Update) of
                  {ok, NewJSON}         -> NewJSON;
                  {error, {Code, Body}} -> {error, api_help:generate_error(Body, Code)}
              end
      end.
  
  
  -spec fetch_refresh_token(UserData::string()) -> string().
  