Update exportRecords.R

implement `apiCall`