use Modern::Perl;
use C4::Output qw(output_with_http_headers);
use C4::Reports::Guided;
use Koha::Reports;
use JSON;
}
print $query->header(
output_with_http_headers( $query, undef, $json_text, 'json');
-charset => 'UTF-8',
-type => 'application/json'
);
print $json_text;
-