add API documentation and examples