Add docstrings to the implementation.
Add an example for the ``_main_for_service`` API.