Refactor get_calls and insert_call + generate UUIDs