Seperated api.js for modularity