If a relation is null return a 404 instead of throwing exception

Due to the result being None an exception is thrown. It makes more sense to me to return a 404 in this case