Use civicrm_api() instead of civicrm_api3()

since checking for is_error.