PEP8 and better handling of application/json