Upgraded to new Javascript API
Merge branch 'feature/new-api'