Added function for json data in main.js