anchor.diff:  		Subscriber#subscriber{multisession = MultiSession},
   	do_write(UpdateSubscriber).
   
  --spec patch_add(Path , Value, Subscriber) -> ok
  -	when
  +-spec patch_add(Id, Path, Value) -> ok
  +	when
  +		Id				:: binary(),
   		Path			:: string(),
  -		Value			:: string(),
  -		Subscriber	:: #subscriber{}.
  +		Value			:: string().
   %% @doc add the give value with given target location.
  -patch_add(Path , Value, Subscriber) ->
  +patch_add(Id, Path, Value) ->
   	[Target, Location] = string:tokens(Path, "/"),
  -	patch_add1(Target , Value, Location, Subscriber).
  -%% @hidden
  -patch_add1("buckets" , Value, Location, Subscriber) ->
  +	patch_add1(Target , Id, Value, Location).
  +%% @hidden
  +patch_add1("buckets" , Id, Value, Location) ->
  +	[Subscriber] = mnesia:read(subscriber, Id),
   	OldBuckets = Subscriber#subscriber.buckets,
   	patch_add(buckets , Value, Location, OldBuckets, Subscriber).
   %% @hidden
  
positive.code: 				F2 = fun({struct, OpObj}) ->
  					case validate_operation(OpObj) of
  						{"replace", Path, Value} ->
  							ok = patch_replace(Path, Value, Entry);
  						{"add", Path, Value} ->
  							ok = patch_add(Path, Value, Entry);
  						{error, malformed_request} ->
  							throw(malformed_request)
  					end
  
negative.code: 			{error, malformed_request}
  	end.
  
  -spec patch_replace(Id, Path, Value) -> ok
  	when
  		Id				:: binary(),
  		Path			:: string(),
  		Value			:: string().
  %% @doc replace the give value with given target path.
  patch_replace(Id, Path , Value) ->
  	[Target] = string:tokens(Path, "/"),
  	patch_replace1(Target , Id, Value).
  %% @hidden
  patch_replace1("name", Id, Value) ->
  	[Subscriber] = mnesia:read(subscriber, Id),
  	UpdateSubscriber = Subscriber#subscriber{name = list_to_binary(Value)},
  	do_write(UpdateSubscriber);
  patch_replace1("password", Id, Value) ->
  	[Subscriber] = mnesia:read(subscriber, Id),
  	UpdateSubscriber =
  		Subscriber#subscriber{password = list_to_binary(Value)},
  	do_write(UpdateSubscriber);
  patch_replace1("attributes", Id, {array, Value}) ->
  	[Subscriber] = mnesia:read(subscriber, Id),
  	RadAttributes = json_to_radius(Value),
  	UpdateSubscriber =
  		Subscriber#subscriber{attributes = RadAttributes},
  	do_write(UpdateSubscriber);
  patch_replace1("enabled", Id, Value) ->
  	[Subscriber] = mnesia:read(subscriber, Id),
  	Enabled = case Value of
  		"true" ->
  			true;
  