implemented reverse index in Python API