Compress json

- remove excessive whitespace in json payload
- fix some PEP8 violations