Bug fixes. The code tried to get an http response code from the request object instead of the response object