only generate JSON data when successcount is higher than 0 since rendering JSON data would fail otherwise.