added validate_hash() and invoices()