some clean up and fixes to things that recently changed
added isDebug() getPluginDir() and getDB() to WebAPI class