Avoid unnecessary AJAX calls in rendering dashboard and avoid popup blocking for downloading a file