Changed error response to be 404 instead of 500