update_resource to check for unicode and str values.