added path_query method and fixed a few request generation bugs