Splitting insight api calls into there own js file