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:             ?ERR("channel_id=~s method=~p path=~s "
                   "time=~w exception=~1000p:~1000p stack=~1000p",
                   [ChannelId, Method, Path, Time1, Class, Exception,
                    erlang:get_stacktrace()]),
              exit(normal)
      end.
  
  handlers() ->
  
negative.code:                 ?INFO("at=request channel_id=~s method=~p path=~s "
                        "resp_code=~w time=~w body=~s",
                        [ChannelId, Method, Path, Code, Time, Details])
          end
      catch
          exit:normal ->
              exit(normal);
  