REST query bugfix