fixed an issue with bad requests and error responses