anchor.diff:      N -> string:substr(Path, 1, string:len(Path) - (N+1))
     end.
   
  +% Query about the top level request path is
   top_level_request(Path) ->
     case string:tokens(Path, "/") of
       [CleanPath|_Others] -> CleanPath;
  
positive.code:         "
        end,
        Req:ok({"text/html", IndexContents});
      assets -> Req:ok(assets:get(ControllerPath));
          
      ControllerAtom -> 
        ?INFO("Using controller: ~p (~p)~n", [ControllerAtom, Req:get(method)]),
        Body = case Req:get(method) of
          'GET' -> ControllerAtom:get(ControllerPath);
          'POST' -> ControllerAtom:post(ControllerPath, decode_data_from_request(Req));
          'PUT' -> ControllerAtom:put(ControllerPath, decode_data_from_request(Req));
          'DELETE' -> ControllerAtom:delete(ControllerPath, decode_data_from_request(Req));
          Other -> subst("Other ~p on: ~s~n", [users, Other])
        end,
        ?INFO("Received ~p~n", [Body]),
        case Body of
          {ok, Code, ExtraHeaders, RetBody} ->
            JsonBody = jsonify(RetBody),
            Req:respond({Code, [{"Content-Type", "text/json"} | ExtraHeaders], JsonBody});
          Else -> 
            JsonBody = jsonify(Else),
            Req:ok({"text/json", JsonBody})
        end
    end.
  
  jsonify(JsonifiableBody) ->
    [ ?JSON_ENCODE({
  
negative.code:   {struct, Struct} = mochijson2:decode(Data),
    Struct.
  
  % Find the method used as a request. 
  % This turns 'GET' into get
  clean_method(M) ->
    case M of
      % This is a hack... FOR NOW
      'OPTIONS' -> get;
      _ -> erlang:list_to_atom(string:to_lower(erlang:atom_to_list(M)))
    end.
  
  % parse the controller path
  parse_controller_path(CleanPath) ->
  