added schema and resourceful rest api for documents