Made API calls work with HTTPS