moved json methods to daemon.py