public IHttpActionResult LoginAccount([FromBody] LoginAttemptModel loginAttempt) { try { // Model Binding Validation if (!ModelState.IsValid) { return(BadRequest()); } // Try to login and get token return(Ok(_userManager.LoginAccount(loginAttempt))); } catch (Exception e) { var newError = new Exception(e.Message, null); return(InternalServerError(newError)); } }