fix query string detection for RESTful API