Adding docs to api.js