Adding index.php to support Cedar stack on Heroku
changed keys
added error handling
added error handling
added comments