Fixing issue with authorization errors by explicitly settings https for API requests. Stooopid me. Sorry.