backend and a few unit tests