add json api and loop through data