public IHttpActionResult Register(user newUser) { try { // user newUser = new user(); if (ModelState.IsValid) { if (bllService.RegisterUser(newUser)) { return(Ok()); } else { return(BadRequest("username exists")); } } else { return(BadRequest("Invalid modelstate")); } } catch (Exception) { throw; } }