made JavaScript SDK work with new v1.1 API