encode empty lists and objects