fix most bugs in backend, two seem not right, need more data to test