Added the code for the request polling and sending the final
response.