Rest API's and return codes

One of the things that I am trying to work on at the moment is with some Ajax stuff, currently I am using a /myapidir/myapimethod/ and under a lot of normal circumstances this works great.

But I decided to hit an unknown API method, and I am curious on how others are handling unknown methods and returning http status codes.

From what I can tell the framework at this stage, treats everything as a handler/method and has no checks to see if it is a restful API. That means no HTTP status codes are returned. I guess this is no big deal, but I am wondering if the framework could identify whether it is a RESTful API or standard handler/API?

Any thoughts?