Use location header not JSON url
Add test for onlyStats