anchor.diff:  
   rest_init(Req, _State) ->
       PoolMember = pooler:take_member(riak_pool),
  -    {ok, Req, PoolMember}.
  -
  -content_types_accepted(Req, Pid) ->
  +    {ok, Req, {PoolMember, []}}.
  +
  +content_types_accepted(Req, State) ->
       {[{{<<"application">>, <<"cdmi-capability">>, '*'}, from_cdmi_capability},
         {{<<"application">>, <<"cdmi-container">>, '*'}, from_cdmi_container},
         {{<<"application">>, <<"cdmi-object">>, '*'}, from_cdmi_object}
  -     ], Req, Pid}.
  -
  -content_types_provided(Req, Pid) ->
  +     ], Req, State}.
  +
  +content_types_provided(Req, State) ->
       {[{{<<"application">>, <<"cdmi-capability">>, '*'}, to_cdmi_capability},
         {{<<"application">>, <<"cdmi-container">>, '*'}, to_cdmi_container},
  +      {{<<"application">>, <<"cdmi-domain">>, '*'}, to_cdmi_domain},
         {{<<"application">>, <<"cdmi-object">>, '*'}, to_cdmi_object}
  -     ], Req, Pid}.
  -
  -forbidden(Req, Pid) ->
  +     ], Req, State}.
  +
  +forbidden(Req, State) ->
   %% TODO: Check ACLs here
  -    {false, Req, Pid}.
  -%%    {true, Req, Pid}.
  -    
  -from_cdmi_capability(Req, Pid) ->
  +    {false, Req, State}.
  +%%    {true, Req, State}.
  +    
  +from_cdmi_capability(Req, State) ->
  +    {Pid, _Opts} = State,
       lager:debug("from_cdmi_capability...~p", [Pid]),
       {Path, _} = cowboy_req:path_info(Req),
  -%%    Uri = string:substr(binary_to_list(Path), 6),
       lager:debug("URI: ~p", [Path]),
       {ok, Body, Req2} = cowboy_req:body(Req),
       lager:debug("Body: ~p", [Body]),
       pooler:return_member(riak_pool, Pid),
  -    {<<"{\"jsondoc\": \"number1\"}">>, Req2, Pid}.
  -
  -from_cdmi_container(Req, Pid) ->
  +    {<<"{\"jsondoc\": \"number1\"}">>, Req2, State}.
  +
  +from_cdmi_container(Req, State) ->
  +    {Pid, _Opts} = State,
       lager:debug("from_cdmi_container...~p", [Pid]),
       {Path, _} = cowboy_req:path_info(Req),
  -%%    Uri = string:substr(binary_to_list(Path), 6),
       lager:debug("URI: ~p", [Path]),
       {ok, Body, Req2} = cowboy_req:body(Req),
       lager:debug("Body: ~p", [Body]),
       pooler:return_member(riak_pool, Pid),
  -    {<<"{\"jsondoc\": \"number1\"}">>, Req2, Pid}.
  -
  -from_cdmi_object(Req, Pid) ->
  +    {<<"{\"jsondoc\": \"number1\"}">>, Req2, State}.
  +
  +from_cdmi_domain(Req, State) ->
  +    {<<"{\"jsondoc\": \"domain\"}">>, Req, State}.
  +
  +from_cdmi_object(Req, State) ->
  +    {Pid, _Opts} = State,
       lager:debug("from_cdmi_object...~p", [Pid]),
       {Path, _} = cowboy_req:path(Req),
   %%    Uri = string:substr(binary_to_list(Path), 6),
  
positive.code:                end,
      pooler:return_member(riak_pool, Pid),
      Response.
  
negative.code:             CDMIVersions = string:tokens(L, ","),
              not lists:member(?CDMI_VERSION, CDMIVersions)
      end,
      {Valid, Req, State}.
  
  %% Has the resource has moved, permanently?
  %% If the request asks for a cdmi-container or cdmi-domain, and
  %% the URL does not end with a slash, it has moved permanently.
  moved_permanently(Req, State) ->
      {_Pid, Moved} = State,
      {Moved, Req, State}.
  
  %% Did the resource exist once upon a time?
  %% For non-CDMIobject types that lack a trailing slash,
  %% does that resource exist with a trailing slash?
  previously_existed(Req, State) ->
      {Pid, _Opts} = State,
      lager:info("previously_existed"),
      {Path, _} = cowboy_req:path(Req),
      {BinaryAcceptHeader, _} = cowboy_req:header(<<?ACCEPT_HEADER>>, Req, error),
      Response = needs_a_slash(binary_to_list(Path),
                               State,
                               binary_to_list(BinaryAcceptHeader)),
      lager:info("previously_existed Response: ~p", [Response]),
      State2 = {Pid, Response},
      R = case Response of
              {true, _} -> true;
              false     -> false
          end,
      {R, Req, State2}.
  
  %% Does the resource exist?
  resource_exists(Req, State) ->
      {Pid, _Opts} = State,
      lager:info("resource_exists"),
      {Path, _} = cowboy_req:path(Req),
      Uri = string:substr(binary_to_list(Path), 6),
      Response = case nebula2_riak:search(Pid, Uri) of
  