Revert "Change $link and $query resource to public"

This reverts commit 9e1210cf0b7c551282106d935fe676a9e24e6ad5.