addActivity API and script