cleaned up style in mock responses that need to consider the port of the current MockWebServer

cc @everett-toews this can be used as an example for keystone