added some api javascript