Leak fix
New API for generating JSON with fmt builder