update javascript for communication api