Below is the code I am using
add_action( 'rest_api_init', 'add_custom_users_api');
function add_custom_users_api(){
register_rest_route( 'testing', '/users', array(
'methods' => 'GET',
'callback' => 'get_custom_users_data',
));
}
function get_custom_users_data($data){
//get users by market
$result = "Testing this";
return $result;
}
Below is the response I am getting


register_rest_route( 'testapi', '/apiendpoint', array( 'methods' => 'POST', 'callback' => 'callback_function' ));