adapting example and API docs to new API