adding tests and backend fixes