Use .one() instead of .all() and except on NoResultFound and MultipleResultsFound; import Base from models to ensure proper database initialization