You're looping over the keys, not the values, when you loop over a dict. If it's actually a list, then the default value should be "[]" instead of "{}".