implement more api methods, add server discovery