added lots of functionality, APN token stuff