Fix module API and use consistent names
Fix mainconfig API and use consistent names