anchor.diff:  
   % Normal delayed update: Append urls to the buffer and exit.
   % The requester will get a reply later.
  -handle_cast({{delayed_update, Urls, _Token}, ReplyTo},
  -        #state{delayed = {Waiters, OldUrls}, tag = Tag} = S) ->
  -    if OldUrls =:= [] ->
  -        spawn(fun() ->
  -            timer:sleep(?DELAYED_FLUSH_INTERVAL),
  -            ddfs:get_tag(ddfs_master, binary_to_list(Tag), all, internal)
  -        end);
  -    true -> ok
  -    end,
  -    case validate_urls(Urls) of
  +handle_cast({{delayed_update, Urls, Token}, ReplyTo},
  +            #state{delayed = {Waiters, OldUrls}, tag = Tag} = S) ->
  +    case check_write_token(Token, S) of
  +        false ->
  +            gen_server:reply(ReplyTo, {error, unauthorized});
           true ->
  -            {noreply, S#state{delayed = {[ReplyTo|Waiters], Urls ++ OldUrls}},
  -                S#state.timeout};
  -        false ->
  -            gen_server:reply(ReplyTo, {error, invalid_url_object}),
  -            {noreply, S, S#state.timeout}
  +            if OldUrls =:= [] ->
  +                    spawn(fun() ->
  +                              timer:sleep(?DELAYED_FLUSH_INTERVAL),
  +                              ddfs:get_tag(ddfs_master, binary_to_list(Tag),
  +                                           all, internal)
  +                          end);
  +               true ->
  +                    ok
  +            end,
  +            case validate_urls(Urls) of
  +                true ->
  +                    {noreply, S#state{delayed = {[ReplyTo|Waiters],
  +                                                 Urls ++ OldUrls}},
  +                     S#state.timeout};
  +                false ->
  +                    gen_server:reply(ReplyTo, {error, invalid_url_object}),
  +                    {noreply, S, S#state.timeout}
  +            end
       end;
   
   % Before handling any other requests, flush pending delayed updates
  
positive.code: handle_cast({die, _}, S) ->
      {stop, normal, S};
  
  handle_cast({{get, Attrib, _Token}, ReplyTo}, #state{data = #tagcontent{} = D} = S) ->
      R = case Attrib of
              all ->
                  make_tagdata(S#state.data);
              urls ->
                  list_to_binary(mochijson2:encode(D#tagcontent.urls));
              read_token ->
                  token_encode(D#tagcontent.read_token);
              write_token ->
                  token_encode(D#tagcontent.write_token);
              {user, A} ->
                  case proplists:lookup(A, D#tagcontent.user) of
                      {_, V} -> list_to_binary(mochijson2:encode(V));
                      _ -> unknown_attribute
                  end
          end,
      gen_server:reply(ReplyTo, R),
  
negative.code:             {ok, {ReadToken, WriteToken, Urls,
                    [{K, Value} | proplists:delete(K, User)]}}
      end.
  
  -spec check_write_token(binary(), #state{}) -> bool().
  check_write_token(Token, S) ->
      {_, WriteToken, _, _} = get_current_values(S),
      (Token =:= internal) or (Token =:= WriteToken) or (WriteToken =:= null).
  
  -spec check_read_token(binary(), #state{}) -> bool().
  check_read_token(Token, S) ->
      {ReadToken, _, _, _} = get_current_values(S),
      (Token =:= internal) or (Token =:= ReadToken) or (ReadToken =:= null).
  
  % THOUGHT: Eventually we want to partition tag keyspace instead
  % of using a single global keyspace. This can be done relatively 
  