Add endpoint; fix channel filtering.
Various small fixes:

 - Fix self-connection identification without needing to do swapping.
 - Log json decoding errors.
 - Trap more bad HTTP status codes.
 - Improve logging.