cleaned up code in proxy-server.js