handle rest process