Configure ASP.NET WebAPI to default to JSON

you’ll need to add newtonsoft json to your project.

Application start, add the initialisation code

Now the code itself.