Fixed JSON Output, implemented env variables