Added JSON API for Documents