connect ui to api