Moved _doAPICall to utility file