implementation for json generator;