fixes to request and authenticateToken