("Could not update URL: ", e.message);
          }

          fetchData();
        }

        /**
         * Initializes the application.
         */
        function init() {
          endpointForm.addEventListener("submit", handleFormSubmit);

          // Get endpoint from URL param on load
          const urlParams = new URLSearchParams(window.location.search);
          const endpointFromUrl = urlParams.get("endpoint");

          if (endpointFromUrl) {
            endpointUrlInput.value = endpointFrom