Move restore endpoint into handler