How to create Custom Rest API?

Hi,

I want to create/access my custom table's data via Rest API. Can we create custom REST API as other documented REST Web services like 

GET api.ashx/v2/blogs/posts.xml.

Thanks,

Sudhanshu