added clearcache, and json wrappers