Bug 36483: Make API controllers use $c->objects->to_api
This patch makes all controller methods using direct $object->to_api, rely on $c->objects->to_api.
Direct ->to_api calling prevents things like embeds, +strings, etc to be dealt with correctly.
In some cases this change reduces the code as the authors extracted the embed structure from the stash and passed it explicitly.
I left out two Patrons.pm cases because I need to study it a bit more.
To test:
1. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>