api almost fixed