Added 404 test for db.

Cleaned up some code, removed unnecessary rescue Interrupt.