fix some bugs and support communicate with backend