title: I can not access my ApiController
body: <p>I am trying to create an Api controller used for logging in, which should be used before using my <code>CustomerController</code> (Api) to access data. </p>
  
  <p>The problem is that I am getting a 404 error when I try to access my Login method on <code>AccountController</code>. I am trying to POST to the <code>AccountController</code> as shown in my screenshot below. </p>
  
  <p>Funny thing is that I am able to access my <code>CustomerController</code> (Api) without any problem by pointing my browser to <code>http://localhost:62655/api/customer/cvr/88888888</code>. <strong>Am I missing a convention or something for the POST request?</strong></p>
  
  <p>My WebApi route config is:</p>
  
  <pre><code>public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          config.MapHttpAttributeRoutes();
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  }
  </code></pre>
  
  <p>And added into my Global.asax:</p>
  
  <pre><code>WebApiConfig.Register(GlobalConfiguration.Configuration);
  </code></pre>
  
  <p>My AccountController and CustomerController is looking like so (files merged for brevity):</p>
  
  <pre><code>public class AccountController : ApiController
  {
      public UserManager&lt;ApplicationUser&gt; UserManager { get; private set; }
      private IAuthenticationManager AuthenticationManager
      {
          get
          {
              return HttpContext.Current.GetOwinContext().Authentication;
          }
      }
  
      public AccountController(UserManager&lt;ApplicationUser&gt; userManager)
      {
          UserManager = userManager;
      }
  
      public async Task&lt;HttpResponseMessage&gt; Login([FromBody]LoginApiViewModel model)
      {
          if (!ModelState.IsValid) return Request.CreateResponse(HttpStatusCode.BadRequest, "Username or password is not supplied");
  
          var user = UserManager.Find(model.Username, model.Password);
          if (user != null &amp;&amp; UserManager.IsInRole(user.Id, "Administrator"))
          {
              var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
              AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = true }, identity);
  
              var response = Request.CreateResponse(HttpStatusCode.OK, "Success");
              return response;
          }
  
          return Request.CreateResponse(HttpStatusCode.Unauthorized, "Wrong login");
      }
  }
  
  [Authorize(Roles = "Administrator")]
  public class CustomerController : ApiController
  {
      private readonly ICustomerService _customerService;
  
      public CustomerController(ICustomerService customerService)
      {
          _customerService = customerService;
      }
  
      [ActionName("cvr")]
      public CustomerApiViewModel GetCustomerById(string id)
      {
         var customer = _customerService.GetByCVR(id);
         if (customer == null) throw new HttpResponseException(HttpStatusCode.NotFound);
         var customerViewModel = Mapper.Map&lt;CustomerApiViewModel&gt;(customer);
  
         return customerViewModel;
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/aEopp.png" alt="enter image description here"></p>
  
  <p>The above image returns a 404 error. The program is Fiddler2.</p>
  
  <p>Exception:</p>
  
  <blockquote>
    <p>[HttpException]: The controller for path &#39;/api/account/login&#39;
    was not found or does not implement IController.</p>
  </blockquote>
  
  <p><strong>Based on comments, update - (complete Global.asax and RouteConfig (MVC)</strong></p>
  
  <pre><code> protected void Application_Start()
  {
      AreaRegistration.RegisterAllAreas();
      FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
      RouteConfig.RegisterRoutes(RouteTable.Routes);
      GlobalConfiguration.Configure(WebApiConfig.Register);
      BundleConfig.RegisterBundles(BundleTable.Bundles);
      AutoMapperWebConfiguration.Configure();
  
      GlobalConfiguration.Configuration.EnsureInitialized(); 
  }
  
  public static void RegisterRoutes(RouteCollection routes)
  {
      routes.LowercaseUrls = true;
      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
      routes.MapRoute(
          "DefaultOnlyAction",
          "{action}",
          new { controller = "Home", action = "Index" }
      );
  
      routes.MapRoute(
          "Default",
          "{controller}/{action}/{id}",
          new { controller = "Home", action = "Index", id = UrlParameter.Optional }
      );
  }
  </code></pre>