public async Task<HttpResponseMessage> Post(RegisterBindingModel model)
        {
            try
            {
                var user = new ApplicationUserViewModel()
                {
                    UserName = model.Email,
                    Email = model.Email,
                    Clan = new ClanViewModel { Ime = model.Ime, Prezime = model.Prezime, Status = Status.aktivan }
                };


                bool result = await Service.RegisterUser(Mapper.Map<ApplicationUserPoco>(user), model.Password);
                if (!result)
                {

                    return Request.CreateResponse(HttpStatusCode.InternalServerError, "Failed.");
                }
                else
                {
                    return Request.CreateResponse(HttpStatusCode.OK);
                }
            }
            catch (Exception e)
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest, e.ToString());
            }
        }
        public async Task<IHttpActionResult> Register(RegisterBindingModel model)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            var user = new ApplicationUser() { UserName = model.Email, Email = model.Email };

            IdentityResult result = await UserManager.CreateAsync(user, model.Password);

            if (!result.Succeeded)
            {
                return GetErrorResult(result);
            }

            return Ok();
        }