Fix an error with JSON parsing. Add encoding to source files. PEP8 formating.