Apparently UAPI does not return any error code, just JSON output that has a string "status: 0" whenever the command fails.
As per Neil's request.