Rewrite quest to client-server architecture using sinatra