connect to api rest