Fix bugs, add test against the server