anchor.diff:  jd(Term) ->
     jiffy:decode(Term).
   
  +%% 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).
  +
   l2b(L) ->
     list_to_binary(L).
   
  +%% table names
   tab(L) ->
     T = list_to_existing_atom(L),
     case ets:info(T,size) of
  
positive.code: 
  reply(Req) ->
    case {method(Req),uri(Req),true_headers(Req)} of
      {"PUT",   [Tab,Key],["counter"]} -> ets({counter,Tab,Key});
      {"PUT",   [Tab,Key],["reset"]}   -> ets({reset,Tab,Key});
      {"PUT",   [Tab,Key],[]}          -> je(ets({insert,Tab,Key,body(Req)}));
      {"PUT",   [Tab]    ,[]}          -> je(gcall({create,Tab}));
      {"GET",   [[]]     ,[]}          -> je([l2b(T)||T<-gcall({all,[]})]);
      {"GET",   [Tab]    ,[]}          -> je(ets({keys,Tab}));
      {"GET",   [Tab,Key],[]}          -> ets({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}));
      X                                -> throw({404,X})
    end.
  
  body(Req) ->
  
negative.code:   end.
  
  getter(Tab,Key) ->
    case ets:select(Tab,[{{Key,'_'},[],['$_']}]) of
      [{_,Res}] ->
        case is_integer(Res) of
          true -> integer_to_list(Res);
          false-> Res
  