Fix JSON builder expecting String where it now receives StringIO