anchor.diff:       {token, logplex_drain:token(Drain)},
        {url, uri_to_binary(logplex_drain:uri(Drain))}].
   
  -not_found_json() ->
  -    Json = {struct, [{error, <<"Not found">>}]},
  -    {404, iolist_to_binary(mochijson2:encode(Json))}.
  -
   json_error(Code, Err) ->
  -    {Code, ?JSON_CONTENT,
  -     mochijson2:encode({struct, [{error, iolist_to_binary(Err)}]})}.
  +    Body = mochijson2:encode({struct, [{error, iolist_to_binary(Err)}]}),
  +    {Code, ?JSON_CONTENT, iolist_to_binary(Body)}.
   
   api_relative_url(canary, UUID) when is_binary(UUID) ->
       iolist_to_binary([<<"/v2/canary-fetch/">>, UUID]);
  
positive.code:     {['GET', "^/v2/channels/(\\d+)$"], fun(Req, [ChannelId], _Status) ->
          authorize(Req),
          case channel_info(api_v2, ChannelId) of
              not_found -> not_found_json();
              Info ->
                  {200, ?JSON_CONTENT, mochijson2:encode({struct, Info})}
          end
  
negative.code:             ?ERR("channel_id=~s method=~p path=~s "
                   "time=~w exception=~1000p:~1000p stack=~1000p",
                   [ChannelId, Method, Path, Time1, Class, Exception,
                    erlang:get_stacktrace()])
      end.
  
  handlers() ->
  