However I notice that there are no error detection nor Z (index) reading in the library.
A basic 2 channel quadrature encoder is just a device where one can get rate information (i.e. speed if counting the steps received per fixed time period) or the total accumulated absolute step counted CW or CCW from start of the program. A 'Z' channel is an optional 3rd added channel for some encoders that gives a single pulse, once per revolution of the shaft. This added channel can be used to determine the absolute position of the shaft at any given time or used as a speed indicator pulse if desired. I've never seen a general purpose encoder library that supported a Z channel input, so I think you would be pretty much on your own to include it's capabilities, although it is not a particularly difficult task.
Lefty