Fix deprecation warnings and add persisted token calls.