Add security by moving collection calls to methods that will be run on the server.