<commit_before>package controllers;

import static spark.Spark.*;

import controllers.utils.Request;
import controllers.utils.Response;

import static services.ExerciseListService.*;

public class ExerciseListController {

  public static void init() {
    path("/exercise-lists", () -> {

      /*
       * Get all exercise lists
       */

      get("/", (req, res) -> Response.ok(res, getExerciseLists()));

      /*
       * Get exercise list by id
       */

      get("/:id", (req, res) -> {
        int id = Integer.parseInt(req.params(":id"));
        return Response.ok(res, getExerciseListById(id));
      });

      get("/:id/exercises", (req, res) -> {
        int id = Integer.parseInt(req.params(":id"));
        return Response.ok(res, getExerciseListExercisesById(id));
      });

      exception(NumberFormatException.class, (exception, request, response) ->
        Response.badRequest(response)
      );

      exception(ExerciseListNotFound.class, (exception, request, response) -><commit_msg>fix exercise list listing api url<commit_after>package controllers;

import static spark.Spark.*;

import controllers.utils.Request;
import controllers.utils.Response;

import static services.ExerciseListService.*;

public class ExerciseListController {

  public static void init() {
    path("/exercise-lists", () -> {

      /*
       * Get all exercise lists
       */

      get("", (req, res) -> Response.ok(res, getExerciseLists()));

      /*
       * Get exercise list by id
       */

      get("/:id", (req, res) -> {
        int id = Integer.parseInt(req.params(":id"));
        return Response.ok(res, getExerciseListById(id));
      });

      get("/:id/exercises", (req, res) -> {
        int id = Integer.parseInt(req.params(":id"));
        return Response.ok(res, getExerciseListExercisesById(id));
      });

      exception(NumberFormatException.class, (exception, request, response) ->
        Response.badRequest(response)
      );

      exception(ExerciseListNotFound.class, (exception, request, response) ->
{'fraction_non_alphanumeric': 0.1471882640586797, 'fraction_numerical': 0.0, 'mean_word_length': 2.853107344632768, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5277528', 'n_tokens_mistral': 594, 'n_tokens_neox': 569, 'n_words': 127}