Fix api

Not an actual problem but I'd put messages.append(message) after SESSION.commit().  That way if we did catch db errors thrown by SESSION.commit() in the future, the messages won't be added unless the commit succeeds.