fix query string parsing and return list of remote branches