Expose a callback/promise hook for the API
Add spec file for lib/api.js