Changed IO functionaity to match the EsClient