more robust base64->json parsing