fix typo in docstring, and check for nil responses from API