codegen: refactor ApiTemplate to comply with latest changes

Change-Id: I56fb14080f4b00accfc03e044fba3f7bf04a9f4d
Signed-off-by: Michael Pasternak <mpastern@redhat.com>