anchor.diff:  replace_token(Username, "Refresh-Token", TokenValue) -> replace_token(Username, "refresh_token", TokenValue);
   replace_token(Username, TokenName, TokenValue) ->
       case get_user_by_name(Username) of
  -        {error, Msg} -> {error, Msg};
  +        {error, Msg} -> {error, "User not found on database"};
           {ok, JSON}   ->
               OldToken = lib_json:get_field(JSON, TokenName),
               case OldToken == TokenValue of   % Optimization, to not update if it is not needed
                   true  -> {ok, JSON};
                   false ->
  -                    UserJSON = lib_json:replace_field(JSON, TokenName, TokenValue),
  +                    UserJSON = lib_json:replace_field(JSON, TokenName, list_to_binary(TokenValue)),
                       Update   = lib_json:set_attr(doc, UserJSON),
                       case api_help:update_doc(?INDEX, "user", Username, Update) of
  -                        {ok, NewJSON}         -> {ok, NewJSON};
  -                        {error, {Code, Body}} -> {error, api_help:generate_error(Body, Code)}
  +                        {ok, _} -> {ok, UserJSON};
  +                        {error, _} -> {error, "Not possible to update the user"}
                       end
               end
       end.
  
positive.code:     {struct, Image} = proplists:get_value(<<"image">>, Data),
      URL = proplists:get_value(<<"url">>, Image),
  
      mochijson2:encode({
          struct,[
              {username, ID},
              {email, Email},
              {password, Password},
              {firstname, First},
              {lastname, Last},
              {description, Description},
              {image_url, URL},
              {access_token, AccToken},
              {refresh_token, RefToken},
              {admin, Admin}]
      }).
  
  
  -spec user_is_new(Username::string()) -> tuple().
  
negative.code: %% @end
  -spec put_user(ReqData::tuple(), State::string()) -> {true, tuple(), string()}.
  put_user(ReqData, State) ->
      case openidc:auth_request(ReqData) of
          {error, Msg} -> {{halt, 403}, wrq:set_resp_body(Msg, ReqData), State};
          {ok, _} ->
              case api_help:is_subs(ReqData) or api_help:is_unsubs(ReqData) of
                  false ->
                      Id = api_help:id_from_path(ReqData),
                      {UserJson,_,_} = api_help:json_handler(ReqData, State),
                      %check if doc already exists
                      case {api_help:do_any_field_exist(UserJson,?RESTRCITEDUPDATEUSERS),api_help:do_only_fields_exist(UserJson,?ACCEPTEDFIELDSUSERS)} of
  