Fixed problem with connecting to api