Add docstrings to API functions