WIP: need to adapt api to accept nested docs