added json and file download support