refactor meta-to-record as private helper function,
and change upload to return record instead of meta