Reworked the API for use in rosmod.py