Tuning anomalous Hall effect and spin polarized current in magnetic ultrathin films