public async Task <IActionResult> Pets(long userId, CreatePetViewModel model)
        {
            try
            {
                if (_db.User.Find(userId) == null)
                {
                    return(NotFound(ErrorMessage.UserNotFound()));
                }
                if (_db.Breed.Find(model.BreedId) == null)
                {
                    return(NotFound(ErrorMessage.BreedNotFound()));
                }

                DateTime birthDatetime;
                if (!DateTime.TryParse(model.BirthDatetime, out birthDatetime))
                {
                    return(BadRequest(ErrorMessage.DateTimeWrongFormat()));
                }

                var pet = _mapper.Map <Pet>(model);
                pet.birth_datetime = birthDatetime;
                pet.user_id        = userId;

                if (!_db.Pet.Any(x => x.user_id == userId))
                {
                    pet.is_current = true;
                }

                _db.Pet.Add(pet);
                await _db.SaveChangesAsync();
                await Images(pet.pet_id, model.PetImages);

                return(Json(pet));
            }
            catch (TimeoutException e) { return(BadRequest(ErrorMessage.Exception(e.Message))); }
        }