Added base64 encode for tokens