Add API tests and some refactoring of messages so we can get a user's messages within the webapp.