use sqlalchemy's one() instead of first() where appropriate