forgot to add delete methods to index.php
fix Document->jsonSerialize()
fix Document->patchFromJson()