Rewrote how api modules are defined