Add more testcases
Modify backend to adopt the new interface