connecting with api, Slim framework