fix return types
use error codes instead of OT_FAIL
Merge pull request #318 from mhamrle/otapi_checks_2

Otapi checks 2