throw a 404 error if an invalid id is passed in details or edit pages