added apiStatusByInvoice function for aiding in finding api issues