Stripped server-side restore code. Decided to make 'restore' call from the browser with JS. That'll simplify authentication.