anchor.diff:  		end
   	of
   		Service ->
  -			Body = mochijson:encode(service(Service)),
  +			Body = mochijson:encode(inventory(Service)),
   			Href = ?serviceInventoryPath ++ binary_to_list(Service#service.name),
   			Etag = ocs_rest:etag(Service#service.last_modified),
   			Headers = [{location, Href}, {etag, Etag}],
  
positive.code: 	end,
  	NewAcc = Acc#service{name = Identity, password = Password,
  		multisession = MultiSession, attributes = A2},
  	service(T, NewAcc);
  service([], Acc) ->
  	Acc.
  %% @hidden
  service([name | T], #service{name = undefined} = Service, Chars, Acc) ->
  	service(T, Service, Chars, Acc);
  service([name | T], #service{name = Identity} = Service,
  		Chars, Acc) when is_binary(Identity) ->
  	SId = {"serviceIdentity", binary_to_list(Identity)},
  	Id = {"id", binary_to_list(Identity)},
  	Href = {"href", ?serviceInventoryPath ++ binary_to_list(Identity)},
  	NewChars = lists:keystore("serviceIdentity", 1, Chars, SId),
  	service(T, Service, NewChars, [Id, Href | Acc]);
  service([name | T], #service{name = Identity} = Service,
  		Chars, Acc) when is_list(Identity) ->
  	Id = {"id", Identity},
  	Href = {"href", ?serviceInventoryPath ++ Identity},
  	SId = {"serviceIdentity", Identity},
  	NewChars = lists:keystore("serviceIdentity", 1, Chars, SId),
  	service(T, Service, NewChars, [Id, Href | Acc]);
  service([password | T], #service{password = undefined} = Service, Chars, Acc) ->
  	service(T, Service, Chars, Acc);
  service([password | T], #service{password = Password} = Service,
  		Chars, Acc) when is_binary(Password) ->
  	SPwd = {"servicePassword", binary_to_list(Password)},
  	NewChars = lists:keystore("servicePassword", 1, Chars, SPwd),
  	service(T, Service, NewChars, Acc);
  service([password | T], #service{password = Password} = Service,
  		Chars, Acc) when is_list(Password) ->
  	SPwd = {"servicePassword", Password},
  	NewChars = lists:keystore("servicePassword", 1, Chars, SPwd),
  	service(T, Service, NewChars, Acc);
  service([product | T], #service{product = undefined} = Service, Chars, Acc) ->
  	service(T, Service, Chars, Acc);
  service([product | T], #service{product = ProductRef} = Service, Chars, Acc) ->
  	service(T, Service, Chars, [{"product", ProductRef} | Acc]);
  service([enabled | T], #service{enabled = Enabled} = Service, Chars, Acc) ->
  	service(T, Service, Chars, [{"isServiceEnabled", Enabled} | Acc]);
  service([multisession | T], #service{multisession = MultiSession} =
  		Service, Chars, Acc) ->
  	MS = {"multiSession", MultiSession},
  	NewChars = lists:keystore("multiSession", 1, Chars, MS),
  	service(T, Service, NewChars, Acc);
  service([attributes | T], #service{attributes = []} = Service, Chars, Acc) ->
  	service(T, Service, Chars, Acc);
  service([attributes | T], #service{attributes = Attributes} = Service, Chars, Acc) ->
  	C1 = case lists:keyfind(?AcctInterimInterval, 1, Attributes) of
  		{_, AcctSessionInterval} ->
  			[{"acctSessionInterval", AcctSessionInterval}];
  
negative.code: 		#service{name = Identity, password = Password,
  			attributes = Attributes, product = ProductRef,
  			enabled = Enabled, multisession = MultiSession} =
  			inventory(mochijson:decode(ReqData)),
  		case ocs:add_inventory(Identity, Password,
  				ProductRef, Attributes, Enabled, MultiSession) of
  			{ok, Service1} ->
  				Service1;
  