```php
<?php

require_once '../../core/api_bootstrap.php';

$data = Request::get();

try {

    Validator::required($data,[
        'slug'
    ]);

    $db = new Database();
    $conn = $db->connect();

    $slug = Helper::sanitize($data['slug']);

    $query = "

        SELECT
            sc.id,
            sc.category_id,
            sc.name,
            sc.icon,
            sc.image,
            sc.slug,
            sc.short_description,
            sc.description,
            sc.seo_content,
            sc.meta_title,
            sc.meta_description,
            sc.meta_keywords,
            sc.schema_markup,
            sc.status,
            sc.created_at,

            c.name  AS category_name,
            c.slug  AS category_slug

        FROM sub_categories sc

        JOIN categories c
        ON sc.category_id = c.id

        WHERE sc.slug = :slug
        AND sc.status = 1
        LIMIT 1

    ";

    $stmt = $conn->prepare($query);

    $stmt->execute([
        ':slug'=>$slug
    ]);

    $subcategory = $stmt->fetch();

    if(!$subcategory){
        Response::error("Subcategory not found",404);
    }

    Response::success($subcategory);

}
catch(Exception $e){

    Logger::log("system.log",$e->getMessage());

    Response::error("Server error",500);

}