middleware renders json as http header, removed old stuff