Fixing some errors in API, now it's working