Fix api

I think these can be changed to:
``` python
            SESSION.commit()
            messages.append(message)
```

Omitting the setting of output[] because that's also done after we collect all of the messages.