Better 404 redirect

Set flags if the ID is not found in the database.

TODO: API is returning the destination URL.  If that is set, use that for redirect, otherwise 404.