One approach would be a custom ActionFilter. See here, although it's about MVC the concept is identical to WebAPI:

ASP.NET MVC provides Action Filters for executing filtering logic either before or after an action method is called. Action Filters are custom attributes that provide declarative means to add pre-action and post-action behavior to the controller's action methods.

For example:

    public class MyActionFilter : ActionFilterAttribute
    {
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
           //....
        }

        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
           //....
        }
    }

And use that do decorate your API controllers/actions:

    [MyActionFilter]
    public IEnumerable<string> Get()
    {
        return new string[] { "value1", "value2" };
    }