Moved creation of api to populate_uids; populate_uid now accepts it as an optional parameter