documentation for api.js