  Topological insulator (TI) thin films with surface magnetism are expected to
exhibit a quantized anomalous Hall effect (QAHE) when the magnetizations on the
top and bottom surfaces are parallel, and a quantized topological
magnetoelectric (QTME) response when the magnetizations have opposing
orientations (axion insulator phase) and the films are sufficiently thick. We
present a unified picture of both effects that associates deviations from exact
quantization of the QTME caused by finite thickness with non-locality in the
side-wall current response function. Using realistic tight-binding model
calculations, we show that in $Bi_2Se_3$ TI thin films deviations from
quantization in the axion insulator-phase are reduced in size when the exchange
coupling of tight-binding model basis states to the local magnetization near
the surface is strengthened. Stronger exchange coupling also reduces the effect
of potential disorder, which is unimportant for the QAHE but detrimental for
the QTME, which requires that the Fermi energy lie inside the gap at all
positions.
