added api docs and examples