Override toJSON for collection serialization