completed the switch to new API

(code seems to be working flawlessly for once!)