// GET: api/Employees public async Task <String> Get() { string employeesJson = await client.GetEmployees(); List <AbstractEmployee> employees = new List <AbstractEmployee>(); List <RawEmployee> rawEmployees = JsonConvert.DeserializeObject <List <RawEmployee> >(employeesJson); foreach (RawEmployee rawEmployee in rawEmployees) { AbstractEmployee employee = factory.BuildEmployee(rawEmployee); employees.Add(employee); } return(JsonConvert.SerializeObject(employees)); }