updated api docs and added several code examples