Exact solutions of spin systems via the Kac-Ward method