connect with rest server