Modules API and flex module