added $wpdb global variable, removed shutdown flush filter, added option to disable api loader, and fixed timezone issue