traversing the json to create dom element