shorten the update_data function and add the ability to override temporary credentials with permanent ones