Fixed bug in revised 404 code so that it applies only to item endpoints.