public HttpResponseMessage Get([FromUri] VariantFilter filter) { VariantData data = new VariantData(); List <VariantDBModel> variants = data.GetVariants(filter); HttpResponseMessage response; if (variants.Count() <= 0) { response = Request.CreateResponse(HttpStatusCode.NotFound, new { Message = "No data found matching given parameters values." }); } else { response = Request.CreateResponse(HttpStatusCode.OK, variants); } return(response); }