env fixes
stats sends json
removed old code