Format to PEP8 and refactor response module