added javascript api