make sure the resource type exists before actually uploading it

or trying to perform operations on it, returning a 404 if it
does not exist.