AutoPEP8 code formatting and better redis error handling