updated get_users_key_value_query to encode URL if it contains whitespace