updated JavaScript API documentation