pep8 and pyflakes applied

I didn't do anything with line length yet.
It's better `import *` here. sample_handler is for user side. It may better import all the APIs by default for convenient. Say one wants to use `@catch_status_code_error`, there is no need to tell them to import.