Fix rest handler