added multithread support for JsonRPC