That’s a pretty neat project!
It does look like there is an off-by-one error with the REST API results predicting the previous response?
You seem to be experimenting with two layers of HTM’s, so I will share my findings on that topic too: Video Lecture of Kropff & Treves, 2008