Fix rest module to reset request variables in the before hook