api for js