Refactors InvoiceApiController to use new query methods