Corrected json format, added trust management code.