check to make sure session id match apikey in generate token
convert session to string if object is passed into generate token