add javascript equivalent of api for completion