Added base64 encoding to reduce http requests