I'm not intimately familiar with headers for the e46 M3, but if I recall the cat is on the manifold so you will lose the cats. There are 4 O2 sensors, 2 pre cat and 2 post cat, most headers delete the post cat sensors. These are necessary for the ecu. The secondary air pump injects air into the exhaust to heat the cat up. There are emulators for them. Basically you have to emulate the pre cat sensor seeing a lean condition when the air pump is turned on.