added some comments and made the app write even if the response from the
webserver is a rejection