Restructure api.js
Rename call function (my mistake)