public async Task <IHttpActionResult> GetUserAsync([FromUri] string username) { try { UserDTO user = await _manager.GetUserAsync(username); return(user != null?Json(user) : (IHttpActionResult)BadRequest("no user found!")); } catch (Exception ex) { return(InternalServerError(ex)); } }