Finally got the API working!