add check for response status code in request

possibly also worth looking at headers['content-type'] which should be application/json