Updated Sinatra code to use redirect