Ensure compatibility with JSON library on Python < 2.7

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>