hasattr check for response_class