anchor.diff:      end.
   
   %% Update Metadata
  --spec nebula2_utils:update_data_system_metadata(list(),map(), cdmi_state()) -> map().
  +-spec update_data_system_metadata(list(),map(), cdmi_state()) -> map().
   update_data_system_metadata(CList, Data, State) ->
  -    lager:debug("Entry"),
  -    CapabilitiesURI = nebula2_utils:get_value(<<"capabilitiesURI">>, Data, []),
  -    nebula2_utils:update_data_system_metadata(CList, Data, CapabilitiesURI, State).
  -
  --spec nebula2_utils:update_data_system_metadata(list(),map(), string(), cdmi_state()) -> map().
  +    ?nebMsg("Entry"),
  +    CapabilitiesURI = get_value(<<"capabilitiesURI">>, Data, []),
  +    update_data_system_metadata(CList, Data, CapabilitiesURI, State).
  +
  +-spec update_data_system_metadata(list(),map(), string(), cdmi_state()) -> map().
   update_data_system_metadata(_CList, Data, [], _State) ->
  -    lager:debug("Entry"),
  +    ?nebMsg("Entry"),
       Data;
   update_data_system_metadata(CList, Data, CapabilitiesURI, State) when is_binary(CapabilitiesURI) ->
       update_data_system_metadata(CList, Data, binary_to_list(CapabilitiesURI), State);
   update_data_system_metadata(CList, Data, CapabilitiesURI, State) ->
  -    lager:debug("Entry"),
  +    ?nebMsg("Entry"),
       Domain = get_domain_hash(<<"">>),
       {ok, C1} = nebula2_db:search(Domain ++ CapabilitiesURI, State),
  -    Capabilities = nebula2_utils:get_value(<<"capabilities">>, C1),
  +    Capabilities = get_value(<<"capabilities">>, C1),
       CList2 = maps:to_list(maps:with(CList, Capabilities)),
       nebula2_capabilities:apply_metadata_capabilities(CList2, Data).
   
   %% @doc Update a parent object with a new child
   -spec update_parent(object_oid(), string(), string(), pid()) -> ok | {error, term()}.
   update_parent(Root, _, _, _) when Root == ""; Root == <<"">> ->
  -    lager:debug("Entry"),
  +    ?nebMsg("Entry"),
       %% Must be the root, since there is no parent.
       ok;
   update_parent(ParentId, Path, ObjectType, Pid) ->
  -    lager:debug("Entry"),
  -    lager:debug("Path: ~p", [Path]),
  +    ?nebMsg("Entry"),
  +    ?nebFmt("Path: ~p", [Path]),
       N = case length(string:tokens(Path, "/")) of
               0 ->
                   "";
  
positive.code:     end.
  
  %% @doc Create a CDMI object
  -spec nebula2_utils:create_object({pid(), map()}, object_type(), map()) ->
            {boolean(), map()}.
  create_object(State, ObjectType, Body) ->
      lager:debug("Entry"),
      {Pid, EnvMap} = State,
      Path = binary_to_list(nebula2_utils:get_value(<<"path">>, EnvMap)),
      case get_cache(Path) of
          {ok, Data} ->
              Data;
          _ ->
              case nebula2_utils:get_object_oid(nebula2_utils:get_parent_uri(Path), State) of
                  {ok, ParentId} ->
                      {ok, Parent} = nebula2_db:read(Pid, ParentId),
                      DomainName = nebula2_utils:get_value(<<"domainURI">>, Parent, ""),
                      create_object(State, ObjectType, DomainName, Parent, Body);
                  {notfound, _} ->
                      pooler:return_member(riak_pool, Pid),
  
negative.code: 
  %% TODO: Make delete asynchronous
  handle_delete(Pid, Data, _, _, []) ->
      ?nebMsg("Entry"),
      Oid = get_value(<<"objectID">>, Data),
      case nebula2_db:delete(Pid, Oid) of
          ok ->
               ParentId = get_value(<<"parentID">>, Data, []),
               ObjectName = get_value(<<"objectName">>, Data),
               delete_child_from_parent(Pid, ParentId, ObjectName),
               ok;
          Other ->
              ?nebFmt("Delete failed for object: ~p. Reason: ~p", [Oid, Other]),
              Other
      end;
  handle_delete(Pid, Data, State, Path, [Child | Tail]) ->
      ?nebMsg("Entry"),
      ChildPath = binary_to_list(Path) ++ binary_to_list(Child),
      KeyMap = maps:from_list([{<<"objectName">>, Child},
                               {<<"path">>, list_to_binary(ChildPath)},
                               {<<"parentURI">>, Path}]),
      NewPath = make_search_key(KeyMap),
      {ok, ChildData} = nebula2_db:search(NewPath, State),
      GrandChildren = get_value(<<"children">>, ChildData, []),
      handle_delete(Pid, ChildData, State, list_to_binary(ChildPath), GrandChildren),
      handle_delete(Pid, Data, State, Path, Tail).
  
  