anchor.diff:      {"PUT",   [Tab|Key],["reset"]}   -> je(ets({reset,Tab,Key}));
       {"GET",   []       ,[]}          -> je(ets({sizes,gcall({all,[]})}));
       {"GET",   [Tab]    ,[]}          -> je(ets({keys,Tab}));
  -    {"GET",   [Tab|Key],[]}          -> je(ets({get,Tab,Key}));
  +    {"GET",   [Tab|Key],[]}          -> je(ets({single,Tab,Key}));
  +    {"GET",   [Tab|Key],["multi"]}   -> je(ets({multi,Tab,Key}));
       {"GET",   [Tab|Key],["next"]}    -> je(ets({next,Tab,Key}));
       {"GET",   [Tab|Key],["prev"]}    -> je(ets({prev,Tab,Key}));
  -    {"GET",   [Tab|Key],["multi"]}   -> je(ets({multi_get,Tab,Key}));
       {"POST",  [Tab]    ,[]}          -> je(ets({insert,Tab,body(Req)}));
       {"DELETE",[Tab]    ,[]}          -> je(gcall({delete,Tab}));
       {"DELETE",[Tab|Key],[]}          -> je(ets({delete,Tab,Key}));
  
positive.code:   ets:insert(Tab,{Key,Beg}),
    Beg.
  
  %% key for inserts/deletes
  ikey(L) ->
    list_to_tuple([ielem(E) || E <- L]).
  
  ielem("_") -> throw({404,key_has_underscore});
  ielem(E)   -> l2b(E).
  
  %% key for lookups
  lkey(L) ->
    list_to_tuple([lelem(E) || E <- L]).
  
  lelem("_") -> '_';
  lelem(E)   -> l2b(E).
  
  %% exporting keys
  elems_to_binary(T) ->
    l2b(join(tuple_to_list(T),<<"/">>)).
  
  join([E],_) -> [E];
  join([E|R],D) -> [E,D|join(R,D)].
  
  %% importing keys
  binary_to_elems(B) ->
    string:tokens(binary_to_list(B),"/").
  
  l2b(L) ->
    list_to_binary(L).
  
  %% table names
  tab(L) ->
  
negative.code:                rets_client:get(localhost,tibbe,'a')),
    ?assertEqual({404,"multiple_hits"},
                 rets_client:get(localhost,tibbe,'a/_/_')),
    ?assertEqual({200,[{"a/1/x","primo"},{"a/2/x","segundo"}]},
                 rets_client:get(localhost,tibbe,'a/_/_',multi)),
    ?assertEqual({404,"no_such_key"},
                 rets_client:get(localhost,tibbe,'b/_/_',multi)).
  