refactor proxy server; break out request handling
set response headers for router 404s/502s

[#55840854]