phase 3 sinatra to rails