fixed api.py; trying to connect everything