public async Task <ActionResult <Day> > GetDay(int habitId, int id) { try { var result = await _repository.GetDayAsync(habitId, id); if (result == null) { return(NotFound($"No day with an id of {id} found!")); } return(Ok(result)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }