All server connect actions are Php files that get executed so nobody will ever see their code - just the results.
This brings us to the second point what data you want the public to see?
If you are a public site then it is all fine, you should show all data as you need it on your pages as well.
However if you have restricted areas on your site, for example behind security provider login, it is also logical to secure the data feeds ( Server Connect api files) that are used.
Happily that is very easy to do by including a security provider restrict step in them as first step. So the same login as used to secure your pages with security provider is also used for the separate server connect app calls.
If you are using an Apache server, you can disable indexing with the .htaccess file.
Empty htm file is not really a solution especially with many dynamic folders
ah you just need to disable directory listing on your web server. Usually this is disabled I wonder how you enabled it at all as it is a very bad thing to have on a live web site.
Sorry @updates if i had understood that your server was showing the directory listing i could have actually helped you, my bad. In South Africa most hosting companies seem to leave this on and i always start off turning that off in my .htaccess file and setting php commands in a .user.ini file too.
A more secure alternative is If the data is high value or confidential in nature I’d highly recommend encrypting it prior to uploading. Then uploading/storing it on a white-list protected User area with strong enforcement. We do this by implementing a self hosted VPN (Open VPN) with Users granted specific dedicated I.P addresses and permissions. Upon access these IPs/Users are then directed to their respective secure area. All other connections outside of these IPs are ignored and a log file is then created. Some clients demand a little more security than others…