cleaned up api.js
Merge branch 'accessWithMongo'