fix api, pep8 and pyliny