rework json stuff for tokens