Raise 404 for entities that don't exist

Fixes #17