Using index when it is available to printUserKeys()
Added jsonrpc support