anchor.diff:  bucket1([id | T], #bucket{id = undefined} = B, Acc) ->
   	bucket1(T, B, Acc);
   bucket1([id | T], #bucket{id = ID} = B, Acc) ->
  -	bucket1(T, B, [{"id", ID} | Acc]);
  +	Id = {"id", ID},
  +	Href = {"href", "/balancerManagement/v1/bucket/" ++ ID},
  +	bucket1(T, B, [Id, Href | Acc]);
   bucket1([name | T], #bucket{name = undefined} = B, Acc) ->
   	bucket1(T, B, Acc);
   bucket1([name | T], #bucket{name = Name} = B, Acc) ->
   	bucket1(T, B, [{"name", Name} | Acc]);
   bucket1([remain_amount | T], #bucket{remain_amount = undefined} = B, Acc) ->
   	bucket1(T, B, Acc);
  -bucket1([remain_amount | T], #bucket{remain_amount = RemainAmount} = B, Acc)
  -		when is_integer(RemainAmount) ->
  -	RM = {"remainAmount", {struct, [{"amount", RemainAmount}]}},
  +bucket1([remain_amount | T], #bucket{units = undefined,
  +		remain_amount = RemainAmount} = B, Acc) when is_integer(RemainAmount) ->
  +	RM = {"remainedAmount", {struct, [{"amount", RemainAmount}]}},
   	bucket1(T, B, [RM | Acc]);
  +bucket1([remain_amount | T], #bucket{remain_amount = RemainAmount,
  +		units = Units} = B, Acc) when is_integer(RemainAmount) ->
  +	RM = {"remainAmount", {struct, [{"amount", RemainAmount},
  +			{"units", units(Units)}]}},
  +	bucket1(T, B, [RM | Acc]);
  +bucket1([reservations | T], #bucket{reservations = []} = B, Acc) ->
  +	bucket1(T, B, Acc);
  +bucket1([reservations | T], #bucket{units = undefined,
  +		reservations = Reservations} = B, Acc) ->
  +	Amount = lists:sum([A || {_, A, _} <- Reservations]),
  +	Reserved = [{"amount", Amount}],
  +	bucket1(T, B, [{"reservedAmount", {struct, Reserved}}| Acc]);
  +bucket1([reservations | T], #bucket{reservations = Reservations,
  +		units = Units} = B, Acc) ->
  +	Amount = lists:sum([A || {_, A, _} <- Reservations]),
  +	Reserved = [{"amount", Amount}, {"units", units(Units)}],
  +	bucket1(T, B, [{"reservedAmount", {struct, Reserved}}| Acc]);
   bucket1([start_date | T], #bucket{start_date = undefined,
   		termination_date = End} = B, Acc) when is_integer(End) ->
   	ValidFor = {struct, [{"endDateTime", ocs_rest:iso8601(End)}]},
  
positive.code: 			{error, 400}
  	end.
  %% @hidden
  get_balance1(Identity, Buckets, ActStatus) ->
  	Id = {"id", Identity},
  	Href = {"href", "/balanceManagement/v1/buckets/" ++ Identity},
  	BucketType = {bucketType, ""},
  	Balance = accumulated_balance(Buckets),
  	RemAmount = {"remainedAmount", Balance},
  	Status = {"status", ActStatus},
  	Object = [Id, Href, BucketType, RemAmount, Status],
  	Json = {struct, Object},
  	Body  = mochijson:encode(Json),
  	{ok, [{content_type, "application/json"}], Body}.
  
  -spec top_up(Identity, RequestBody) -> Result
  	when
  
negative.code: 		Identity :: list(),
  		Result :: {ok, Headers :: [tuple()], Body :: iolist()}
  				| {error, ErrorCode :: integer()}.
  %% @doc Body producing function for `GET /balanceManagment/v1/product/{id}/bucket'
  %% reuqest
  get_balance(Identity) ->
  	try
  		case ocs:find_subscriber(Identity) of
  			{ok, #subscriber{buckets = Buckets}} ->
  				get_balance1(Identity, Buckets);
  			{error, not_found} ->
  				{error, 404};
  			{error, _Reason} ->
  				{error, 500}
  		end
  