Change json decoding based on python version