Updated and formatted the exported json logic.