Re-implement backend as Sinatra app