Added some error handling

Could not get the app working on heroku, so added some error handling in
hopes of better understanding of the problem.