Add note history API + unittests