GetAllFlights([FromQuery(Name = "relative_to")] string relative_to)
        {
            if (relative_to.Contains('T'))
            {
                relative_to = relative_to.Replace('T', ' ');
            }
            List <Flight> flights      = new List <Flight>();
            bool          checkSyncAll = Request.Query.ContainsKey("sync_all");

            if (checkSyncAll)
            {
                //need to get flights from out servers
                List <Flight> exFlights = await externalFlights.GetExternalFlights(relative_to);

                if (exFlights != null)
                {
                    exFlights = externalFlights.ChangeBoolEX(exFlights);
                    flights.AddRange(exFlights);
                }
            }

            //the list of flights we will send to the client to update the marker
            //we need to get from the db all the flight plan that are relvante
            List <FlightPlanDB> flightList = sql.FlightsList(relative_to);

            for (int i = 0; i < flightList.Count; i++)
            {
                string     id         = flightList[i].GetId();
                FlightPlan flightPlan = flightList[i].GetFlightPlan();

                //step 1. subset from  current datetime to initial(need to convert the string).
                double diff = calculator.SubTime(flightPlan.Initial_Location.Date_Time,
                                                 relative_to);
                //interpolsion-get the current point
                Coordinate currentPlace = calculator.CurrentPlace(relative_to, flightPlan, diff);
                flights.Add(new Flight(id, currentPlace.Lng, currentPlace.Lat,
                                       flightPlan.Passengers, flightPlan.Company_Name,
                                       flightPlan.Initial_Location.Date_Time, false));
            }
            if (flights.Count == 0)
            {
                return(new List <Flight>());
            }
            else
            {
                return(Ok(flights));
            }
        }