updated API documentation and added example