fix bugs in generate json; add logic to consistent check in ui and show tooltips for failure