Put JSON function in JS file