All the functions return a success/fail status.

Perhaps you can begin with checking those things.