Remove closing tag that has no corresponding opening tag
Use the model API rather than calling sqlalchemy in the controller