added token verification functionality

TODO: abstract this functionality into a module