public async Task <IHttpActionResult> GetById([FromUri] int id) { try { var data = await _dataProcessor.GetById(id); if (data != null) { return(Ok(data)); } else { return(NotFound()); } } catch (BusinessLayerException ex) { var errors = default(string); foreach (var item in ex.Errors) { errors += item; } return(BadRequest(errors)); } }