almost connected to rest api