Add arg checking, fix disconnect arguments
Fix simple test
Add `test/api-test.js`