CreateJson rewritten