public async Task <ActionResult <Invoices> > GetInvoices() { try { return(Ok(await invoicesRepository.GetAllInvoices())); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "Error retrieving data from database")); } }