Sinatra tutorial from http://www.sitepoint.com/just-do-it-learn-sinatra-iv/ with some changes