added POST data and end events to server.js