Initial implementation of update_metadata.