various fixes

* match JSON destination with src directory structure
* add test