customizable max nesting for json serialization