adding daemon mode for json rpc