Fix error on API calls returning empty body.

Fixes #41.