add topic and update web api

fix bugs, add topic function and update web api