Switched API and implemented SMA