added error handling for 404 and 500 errors also tweaked production.rb