you are getting the data in the JavaScript but you don't pass it over to the browser
you can use the html tag to pass it over on the a click by setting the href value to your controller
or you can create a Blob in memory and fill it in with the value of your controller response and than create a element and set the value to your Blob and trigger a click on the element
you can see hare a example How to export JavaScript array info to csv (on client side)?