Return 404 if target id of put/patch request does not exist.

Currently, a put/patch request to an invalid ID fails the assert on line 1164 in views.py.  We should handle this gracefully, so we abort with a 404.

A 404 error is in line with what is returned if a GET request is issued for an invalid id.