Adding support for response class on error responses