added api and example