working search function and rendered json to the dom