Fixed the API - had to comment out the last section of AI API for testing