add location header to create + test
add tests and fix some bugs in stats