Revert "Modify return codes from the API per #299"

This reverts commit 1de70a8d2634b2fb9e7797ffcc4709c4236686bb.
Revert "Revert 1de70a8d2634b2fb9e7797ffcc4709c4236686bb"

This reverts commit 959407bc34d9552586538a58dec6d8e70add9064.