added json output and json handlers
added userprefs