Adding source
Getting WebApi routing working.

I found the following problems:

  * There was a duplicate Windsor registration of IDepartmentsRepository which was causing an exception to be thrown during startup.
  * I had to replace the WebApiConfig.Register call in Global.asax.cs with a call to GlobalConfiguration.Configure. Previously I was getting a 404 (but that could just be a difference between my machine and yours).
  * I removed some of the MapRoutes calls that would have caused the MVC framework to handle the WebApi routes.

Additionally, I moved all the API controllers into an api folder to make things easier to understand, and I used attribute routing on the DepartmentsController. An example call is GET /api/Departments/Count.
Using attribute routing isn't necessary, but it's normally easier to create a decent API with.