added generic constructor to index_t, implemented C api index value function