anchor.diff:  	#subscriber{name = Username, password = Password, product = ProductInstance};
   inventory(#subscriber{name = Username, password = Password,
   		product = #product_instance{characteristics = Chars}  = ProductInstance}) ->
  -	F = fun(CChars, _, undefined) ->
  +	F1 = fun(CChars, _, undefined) ->
   			CChars;
   		(CChars, Key, Value) ->
   			lists:keystore(Key, 1, CChars, {Key, binary_to_list(Value)})
   	end,
  -	Chars1 = F(Chars, "subscriberIdentity", Username),
  -	Chars2 = F(Chars1, "subscriberPassword", Password),
  -	instance(ProductInstance#product_instance{characteristics = Chars2}).
  +	Chars1 = F1(Chars, "subscriberIdentity", Username),
  +	Chars2 = F1(Chars1, "subscriberPassword", Password),
  +	{struct, Json1} = instance(ProductInstance#product_instance{characteristics = Chars2}),
  +	F2 = fun(Key) ->
  +			case proplists:get_value(Key, ProductInstance#product_instance.characteristics) of
  +				undefined ->
  +					undefined;
  +				Value ->
  +					Value
  +			end
  +	end,
  +	Username1 = F2("subscriberIdentity"),
  +	Id = {"id", Username1},
  +	Href = {"href", "product/product/" ++ Username1},
  +	{struct, lists:sort([Id, Href | Json1])}.
  +
   
   -spec instance(Instance) -> Instance
   	when
  
positive.code: instance([characteristics | T], #product_instance{characteristics = Chars} = ProductInstance, Acc) ->
  	Characteristics = {"characteristics", characteristics(Chars)},
  	instance(T, ProductInstance, [Characteristics | Acc]);
  instance([_ | T], ProductInstance, Acc) ->
  	instance(T, ProductInstance,  Acc);
  instance([], _ProductInstance, Acc) ->
  
negative.code: 	instance(T, Acc#product_instance{characteristics = NewChars});
  instance([{"productOffering", {struct, Offer}} | T], Acc) ->
  	instance(T, Acc#product_instance{product = product({struct, Offer})});
  instance([{"status", Status} | T], Acc) ->
  	instance(T, Acc#product_instance{status = product_status(Status)});
  instance([{"startDate", SDate} | T], Acc) ->
  	instance(T, Acc#product_instance{start_date = ocs_rest:iso8601(SDate)});
  instance([{"terminationDate", TDate} | T], Acc) ->
  	instance(T, Acc#product_instance{termination_date = ocs_rest:iso8601(TDate)});
  instance([_ | T], Acc) ->
  	instance(T, Acc);
  instance([], Acc) ->
  