Change $link and $query resource to public