anchor.diff:  %% Copyright (c) 2010 Jacob Vorreuter <jacob.vorreuter@gmail.com>
  -%% 
  +%%
   %% Permission is hereby granted, free of charge, to any person
   %% obtaining a copy of this software and associated documentation
   %% files (the "Software"), to deal in the Software without
  
positive.code:         authorize(Req),
          Drains = logplex_channel:lookup_drains(list_to_integer(ChannelId)),
          not is_list(Drains) andalso exit({expected_list, Drains}),
          
          Drains1 = [{struct, [{token, Token}, {host, Host}, {port, Port}]} || #drain{token=Token, host=Host, port=Port} <- Drains, Host =/= undefined],
          {200, iolist_to_binary(mochijson2:encode(Drains1))}
      end},
  
negative.code:                 {404, <<"Failed to create drain">>};
              {error, invalid_drain} ->
                  {400, io_lib:format("Invalid drain syslog://~s:~p", [Host, Port])}
          end
      end},
  
      {['POST', "^/v2/channels/(\\d+)/drains/(\\d+)$"], fun(Req, [ChannelId, DrainId]) ->
  