added back caching, started working on save, fixed bug in get document