Modify return codes from the API per #299

This is a **breaking** change.