fix client bugs
refactor the url & add server's api to client