Trying to adapt the old codebase with the new v3 api calls.