First go at adding token API; needs to be tested