added javascript api to index