What to do if most of the students did badly in the 1st midterm?
What I usually do, and this would also apply in this situation: I tell the students that if their performance improves significantly in the final exam, and if any of the remaining exams/quizes, I am willing to ignore the grade for the first midterm when I calculate their grades.

But they have to prove that the first midterm was an accident. 

This usually motivates them to work harder for the remaining of the class, and for some students a poor first midterm is a good wake up call.