Move sinatra stuff to rails