Fix bug where request doesn't close. Handle any errors on http request.