Change civicrm_api() to civicrm_api3()

This change make errors returned as exceptions which works better with migrate