## 4 The kClusterHub Application
### Web Service  
The kClusterHub web service has been crafted as a REST API, boasting eleven endpoints that expose the kClusterHub's capabilities to external applications via straightforward HTTP requests. To use this service, users/programmers are required to complete a registration process and obtain a personalized API key, which then acts as their ticket to access the full array of functionalities. The integration process is efficient, as every HTTP request is accompanied by the user's API key, ensuring a secure and personalized experience. Table 1 lists the eleven endpoints that the REST API includes. Among these, four endpoints (Nos. 8, 9, 10 and 11) are for user account management, encompassing essential tasks, such as registration, login, account editing and deletion. Additional four endpoints are allocated for dataset management tasks (Nos. 1, 2, 6 and 7). These tasks concern various operations, including dataset upload, retrieval, deletion, and the ability to access dataset attributes and characteristics. The remaining triad of endpoints constitutes the major part of the API since they concern the clustering process. One of these key endpoints (No. 3) executes the elbow method, delivering clustering metrics (such as WCSS) and suggesting the optimal number of clusters. Another pivotal endpoint (No. 4) triggers the clustering algorithm, furnishing users with cluster assignments for their data. The last endpoint (No. 5) generates the exploratory plot for cluster assignments. All requests and responses are conducted in JSON format, facilitating data exchange between the web service and external applications. A few core examples of endpoint calls, along with their corresponding responses are examined hereupon. The endpoint with No. 1 retrieves the datasets' names, which the user can use. Below, an example of response of the http GET call is presented. get-datasets.php?apikey=905a7d7f02b2512 fcf3e02b16 ec52 ab  
JSON response:  
{\"personal_datasets\":[\"LIR.csv\"],  
\"public_datasets\":[\"fuel_prices_52.csv\",\"iris.csv\",  
\"letter.csv\",\"magic.csv\",\"penbased.csv\",  
\"satimage.csv\",\"shuttle.csv\",  
\"telco_2023.csv\",\"texture.csv\" \begin{table}
\begin{tabular}{c c c} \hline \hline
**No.** & **HTTP Method** & **Endpoint** \\ \hline
1 & GET & /api/get-datasets.php?apikey=[apikey] \\ \hline
2 & GET & /api/read-dataset.php?apikey=[apikey]\&dataset=[dataset] \\ \hline
3 & POST & /api/elbow.php \\ \hline
4 & POST & /api/clusters.php \\ \hline
5 & POST & /api/parallel-cords.php \\ \hline
6 & POST & /api/upload-dataset.php \\ \hline
7 & DELETE & /api/delete-dataset.php \\ \hline
8 & POST & /api/register.php \\ \hline
9 & POST & /api/login.php \\ \hline
10 & POST & /api/edit-profile \\ \hline
11 & POST & /api/delete-user.php \\ \hline \hline \end{tabular}
\end{table} 
Table 1: REST API endpoints. The following request concerns the POST endpoint with No 3. It executes the elbow method on the columns 'Age' and 'S'alary' of the 'data.csv' dataset. This dataset is private and belongs to the user who possesses the API key: 0a8366a07c0d8 fccx48 bab2e657f12d0. The elbow method will operate within the range of 1 to 10 clusters. The algorithm value for this request is set to 'auto', enabling the algorithm to be automatically chosen, based on the column types. Alternatively, the algorithm value can also be set to 'k-means', 'k-modes', or 'k-prototypes', allowing the explicit selection of the algorithm. In the case of the example, since both columns are numerical, k-means is used and the corresponding response encompasses the WCSS measurements for various k values, spanning from 1 to 10, along with the recommended optimal number of clusters.