anchor.diff:      AuthURL = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=" ++ Token,
       case plus_srv:get_url(httpc:request(get,{AuthURL,[]},[],[])) of
           {ok, Json} -> {ok, Json};
  -        {error, _} -> {error, "Delivered token already expired"}
  +        {error, _} -> {error, "Token not valid or already expired"}
       end.
   
   
  
positive.code: -spec authenticate_token(TokenName::string(), ReqData::tuple()) -> tuple().
  authenticate_token(TokenName, ReqData) ->
      case wrq:get_req_header(TokenName, ReqData) of
          undefined -> {error, "Not possible to perform the request. Missing " ++ TokenName};
          TokenVal  -> check_valid_token(TokenName, TokenVal)
      end.
  
  
  
negative.code:             end
      end.
  
  % TODO Test this function
  -spec authorize_priviledge_request(ReqData::tuple()) -> tuple().
  authorize_priviledge_request(ReqData) ->
      {JSON, _, _} = api_help:json_handler(ReqData, ""),
      Username = binary_to_list(proplists:get_value(<<"user_id">>, JSON)),
  
      case {is_priviledge(Username), authenticate_request(ReqData)} of
          {false, _}         -> {error, "{\"error\": \"User not authorized\"}"};
          {_, {error, Msg}}  -> {error, Msg};
          {true, {ok, Data}} -> {ok, Data}
      end.
  
  
  -spec is_priviledge(Username::string()) -> boolean().
  is_priviledge(Username) ->
      % case Username of ?FRONTEND_ID or ?PUB_SUB_ID or ?POLLING_ID -> true; _ -> false end.
      (Username == ?FRONTEND_ID) or (Username == ?PUB_SUB_ID) or (Username == ?POLLING_ID).
  
  
  -spec fetch_user_info() -> tuple().
  