Build truly RESTful API and website using same ASP.NET MVC code
Usually we create separate controllers or WCF service layer to deal with API part of the website but I will show you how you can create both RESTful website and API using the same controller code working over the exact same URL.