added derived files
call `toJSON` function of objects (if present) when serializing