Merge pull request #377 from JahPowerBit/develop3

[#338] refresh next tx_index when there is a reorg
fixes #375
catch TypeError in API