WP REST API Remover _links

function devotees_rest_prepare_post($data, $post, $request)
{
    foreach($data->get_links() as $_linkKey => $_linkVal) 
    {
        $data->remove_link($_linkKey);
    }
    return $data;
}

add_filter('rest_prepare_post', 'devotees_rest_prepare_post', 1, 3);
// Custom Post Type: slug => imap
add_filter('rest_prepare_imap', 'devotees_rest_prepare_post', 1, 3);
KostasX