fixed to work with new API endpoints