app.run(Threaded=true) option does not work when deployed on Heroku because I only have one worker for free. New info from the pi doesn't actually get added to the database till after the ajax request is complete. on_off.js should be rewritten to refresh the screen periodically, not on completion of the ajax request.