make handlers return 404 (not 500) when given a non-numeric id

fixes #67