WordPress Custom post type not available in REST API

Good day

I have now tried everything and read through the WordPress documentation and read every post here and on other websites, but I cannot figure out why my custom post is not available via the WordPress REST API.

Here is my code snippet I am using through WPCode Lite:

function Custom_post_type() {
    $labels = array(
        'name'                => _x( 'Line Managers', 'Post Type General Name' ),
        'singular_name'       => _x( 'Line Manager', 'Post Type Singular Name'),
        'menu_name'           => __( 'Line Managers'),
        'parent_item_colon'   => __( 'Parent Line Manager'),
        'all_items'           => __( 'All Line Managers'),
        'view_item'           => __( 'View Line Manager' ),
        'add_new_item'        => __( 'Add New Line Manager' ),
        'add_new'             => __( 'Add New'),
        'edit_item'           => __( 'Edit Line Manager'),
        'update_item'         => __( 'Update Line Manager'),
        'search_items'        => __( 'Search Line Manager'),
        'not_found'           => __( 'Not Found'),
        'not_found_in_trash'  => __( 'Not found in Trash'),
    );
    
    $args = array(
        'label'                 => __( 'line'),
        'description'           => __( 'Line Manager news and reviews'),
        'labels'                => $labels,  
        'supports'              => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),     
        'taxonomies'            => array( 'workplace' ),     
        'hierarchical'          => false,
        'public'                => true,
        'show_ui'               => true,
        'show_in_menu'          => true,
        'show_in_nav_menus'     => true,
        'show_in_admin_bar'     => true,
        'menu_position'         => 5,
        'can_export'            => true,
        'has_archive'           => true,
        'exclude_from_search'   => false,
        'publicly_queryable'    => true,
        'rewrite'               => array( 'slug' => 'line' ),
        'capability_type'       => 'post',
        'query_var'             => true,
        'show_in_rest'          => true, 
        'rest_base'             => 'line',
        'rest_controller_class' => 'WP_REST_Posts_Controller'
    );
    //unregister_post_type('line');

    register_post_type( 'line', $args );
}
add_action( 'init', 'Custom_post_type' );

I can access the normal posts through the API, but not the custom post. Here are the links:
https://dev.freedomsoftware.co.za/wp-json/wp/v2/line

https://dev.freedomsoftware.co.za/wp-json/wp/v2/posts

I have made sure that the permalink structure is set to “Post name”, I have unregistered the post type and reregistered it several times, I made sure I have the "show_in_rest" => true, I have basically tried everything I could find online, unless I missed something and that is why I am asking here.

Any help would be greatly appreciated.