public IHttpActionResult Authenticate(AuthenticateViewModel viewModel) { //Check Security Service MembershipService = new AccountMembershipService(); if (MembershipService.ValidateUser(viewModel.Username, viewModel.Password)) { Sessions.UserId = viewModel.Username; return Ok(new { success = true }); } return Ok(new { success = false, message = "User Id or password is incorrect" }); }