better JSON handling when it comes from the KMS