Capture query string and parse it