support not only json but also html or any filetype (without tests)
fix tests