added raise_request_error and check_session