Exclude empty objects in json generation