added ability to handle post data and return a response