anchor.diff:  -spec initial_nrf(NrfRequest) -> NrfResponse
   	when
   		NrfRequest :: iolist(),
  -		NrfResponse :: {ok, Headers, Body} | {error, Status},
  +		NrfResponse :: {ok, Headers, Body} | {error, Status} |
  +				{error, Status, Body},
   		Headers :: [tuple()],
   		Body :: iolist(),
   		Status :: 201 | 400 | 500.
  
positive.code: %%% ocs_rest_res_nrf.erl
  %%% vim: ts=3
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%% @copyright 2016 - 2021 SigScale Global Inc.
  
negative.code: 					ServiceRating when is_list(ServiceRating) ->
  						UpdatedMap = maps:update("serviceRating", ServiceRating, NrfMap),
  						nrf_response_to_struct(UpdatedMap);
  					{error, out_of_credit} ->
  						Body = error_response(out_of_credit, NrfMap),
  						{error, 403, Body};
  					{error, service_not_found} ->
  						Body = error_response(service_not_found, NrfMap),
  						{error, 404, Body};
  					{error, Reason} ->
  						{error, Reason}
  				end;
  			_ ->
  				Body = error_response(charging_failed, undefined),
  				{error, 400, Body}
  		end
  	of
  		{struct, _Attributes1} = NrfResponse ->
  			RatingDataRef = ocs:generate_identity(),
  			Location = "/ratingdata/" ++ RatingDataRef,
  			ReponseBody = mochijson:encode(NrfResponse),
  			Headers = [{location, Location}],
  			{ok, Headers, ReponseBody };
  		{error, StatusCode, Body1} ->
  			ReponseBody = mochijson:encode(Body1),
  			{error, StatusCode, ReponseBody};
  		{error, _Reason} ->
  			{error, 500}
  	catch
  		_:_ ->
  			{error, 500}
  	end.
  	
  %%----------------------------------------------------------------------
  %%  internal functions
  %%----------------------------------------------------------------------
  
  -spec error_response(Error, NrfMap) -> Result
  	when
  		Error :: term(),
  		NrfMap :: map() | undefined,
  		Result :: {struct, list()}.
  %% @doc Get a error response body.
  error_response(out_of_credit, #{"serviceRating" := SR}) ->
  	{struct, [{"cause", "QUOTA_LIMIT_REACHED"},
  			{"title", "Request denied due to insufficient credit (usage applied)"},
  			{"invalidParams", {array, struct_service_rating(SR)}}]};
  error_response(service_not_found, #{"msisdn" := MSISDN}) ->
  	{struct,[{"cause","USER_UNKNOWN"},
  			{"title", "Request denied because the subscriber identity is unrecognized"},
           {"invalidParams",
            {array,[{struct,[{"param", MSISDN},
                             {"reason","unknown msisdn"}]}]}}]};
  error_response(charging_failed, _) ->
  	{struct,[{"cause","CHARGING_FAILED"},
  			{"title", "Incomplete or erroneous session or subscriber information"}]}.
  
  -spec rate(NrfRequest, Flag) -> Result
  	when
  