fixing the invoices generate endpoint