fixed serialization of empty objects

JSON should be `{}` rather than `[]`