public void monitorTesla(VehicleCaller execute) throws InterruptedException {
    while (true) {
      try {
        HttpGet loginPage = new HttpGet(baseURL + "login");
        client.execute(loginPage).getStatusLine();
        HttpPost login = new HttpPost(baseURL + "login");
        BasicNameValuePair email = new BasicNameValuePair("user_session[email]", config.getProperty("email"));
        BasicNameValuePair password = new BasicNameValuePair("user_session[password]", config.getProperty("password"));
        login.setEntity(new UrlEncodedFormEntity(Arrays.asList(email, password)));
        HttpResponse loginResponse = client.execute(login);
        if (loginResponse.getStatusLine().getStatusCode() == 302) {
          String location = loginResponse.getFirstHeader("Location").getValue();
          login.releaseConnection();
          if (location.equals(baseURL)) {
            logger.log(Level.INFO, "Successfully connected to Tesla");
            while (true) {
              JsonNode vehiclesArray = getResult("vehicles");
              for (final JsonNode vehicle : vehiclesArray) {
                String state = vehicle.get("state").asText();
                if (state.equals("online")) {
                  final long vehicleId = vehicle.get("id").asLong();
                  if (!execute.call(vehicleId, vehicle)) {
                    break;
                  }
                }
              }
              Thread.sleep(period * _1_MIN_MILLIS);
            }
          }
        } else {
          login.releaseConnection();
          logger.info("Connected and got status: " + loginResponse.getStatusLine().getStatusCode());
          Thread.sleep(10000);
        }
      } catch (Exception e) {
        logger.log(Level.SEVERE, "Failed to get vehicle information", e);
        client.getConnectionManager().shutdown();
        client = new DefaultHttpClient();
        Thread.sleep(period * _1_MIN_MILLIS);
      }
    }
  }