Updated to latest Javascript API
Merge branch 'feature/new-api'