demo for connect to api server successfully