refactor api and web server.  update to use sinatra 1.4.4.