title: How to decide between returning 404 or 405 status on undefined REST routes
body: <p>I'm writing a RESTful API and I have a doubt. I've created a controller that handles requests to undefined resources (I mean incorrect URIs, not correct URIs but with inexistent IDs).</p>
  
  <p>My first intuition was to return a 404 status code to tell the client the resource doesn't exist (on GET requests), but when I started to generalize the logic to handle HEAD, OPTIONS, POST, PUT and other HTTP verbs, I though that maybe the best idea is to return a 405, since in fact, It's not allowed to use these methods (including the GET) on invalid routes.</p>
  
  <p>In the response for the OPTIONS method I'm returning an empty list of allowed methods (I don't include the OPTIONS method neither, even if it's returning a response).</p>
  
  <p>What do you think? Any ideas? I think this field is a little bit fuzzy.</p>