Add token getting function.