In This Blog, You Can Have The Complete Source Code Of Creating And Consuming ASP.NET Web API using Visual Studio.
We can use the MVC for developing the Web application that return both data and views but the Web API is used for generating the HTTP services that returns only data.
ASP.NET Web API is a framework that makes it easy to build HTTP web services (Restful HTTP services).