rendering json, working on click function