removed duplicated call to filter placeholders
moved applysyntaxfilter up to avoid surplus work on thrown-away objects
REST queries are removed from groupRelatedObjects to save on performance