Just tried to replicate `first_or_404` of `Flask-sqlalchemy`.