Update all api endpoints to be backed by sqlalchemy