added php files that generate json output for ajax calls for devices and readings