Added support for debug mode on localhost and for live mode, on heroku