Fix successful msg counting in batches >1000 when sending JSON request

Previously, success count of the last batch would be set as overall success count
Fix incorrect method precondition check