Pay attention to the stress: in -AR verbs in the nosotros form the stressed á is written — hablábamos. In -ER/-IR verbs the stress falls on í in all forms without exception — this is that very dot over the i that cannot be skipped in writing.
Now the three exceptions that will have to be memorised separately:
Ser: era, eras, era, éramos, erais, eran
Ir: iba, ibas, iba, íbamos, ibais, iban
Ver: veía, veías, veía, veíamos, veíais, veían
Ver is formally irregular, but in practice almost regular — its stem ve- is preserved in all forms, and the standard endings of the -ER/-IR group are simply added to it. Not difficult to remember.
It is worth mentioning separately the verbs with stem alternation — those that in the Presente change the vowel (e→ie, o→ue, etc.). In the imperfect this alternation does not happen. Poder in Presente gives puedo, puedes — but in the imperfect it is calm: podía, podías, podía. This is a pleasant exception to the rule about exceptions.