public async Task <IActionResult> GetAllFamilies([FromQuery] bool includeLinks = true, [FromQuery] bool includeMammals = false)
        {
            try
            {
                var results = await _familyRepository.GetAllFamilies(includeMammals);

                if (results.Length == 0)
                {
                    throw new System.Exception($"Cant find any families");
                }

                IEnumerable <FamilyDTO> mappedResult = _mapper.Map <FamilyDTO[]>(results);

                if (includeLinks)
                {
                    foreach (var family in mappedResult)
                    {
                        family.Mammals = family.Mammals.Select(m => HateoasMainLinks(m)).ToList();
                    }
                }

                if (includeLinks)
                {
                    IEnumerable <FamilyDTO> resultWithLinks = mappedResult.Select(r => HateoasMainLinks(r));
                    return(Ok(resultWithLinks));
                }

                return(Ok(mappedResult));
            }
            catch (TimeoutException e)
            {
                return(this.StatusCode(StatusCodes.Status408RequestTimeout, $"Request timeout: {e.Message}"));
            }
            catch (Exception e)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Database Failure: {e.Message}"));
            }
        }