Move HTTPS check to Klein and out of the API class