Restructured API python files