fix bugs and  add unit tests
Merge branch 'backend-new' of https://github.com/StickMen/KungFuRhino.git