How to map WebAPI routes correctly
<p>I'm building an API for a Twitter like site using Web API and have trouble with mapping the routes</p>

<p>I have the following actions for the User controller:</p>

<pre><code>public User Get(string firstname, string lastname)
public User Get(Guid id)
public User Friends(Guid id)
public User Followers(Guid id)
public User Favorites(Guid id)
</code></pre>

<p>The desired routes and the generated documentation should be:</p>

<pre><code>api/users?firstname={firstname}&amp;lastname={lastname}
api/users/{id}
api/users/{id}/friends
api/users/{id}/followers
api/users/{id}/favorites
</code></pre>

<p>In WebApiConfig.cs I have:</p>

<pre><code>config.Routes.MapHttpRoute(
    "2",
    "api/{controller}/{id}",
    new { action = "get", id = RouteParameter.Optional }
);


config.Routes.MapHttpRoute(
     "1",
     "api/{controller}/{id}/{action}"
);
</code></pre>

<p>How can I map WebAPI routes correctly?</p>