fix Endpoint JSON serialization

Getting the host address from an endpoint shouldn't require a round trip through the InetSocketAddress. Ensure any Endpoint being serialized to JSON is first wrapped by the JsonEndpoint.