Added more detail to the API and example code