fix pep8, and add some api