@Override
  public List<Endpoint> getEndpoints() throws ArangoException {

    Type type = new TypeToken<List<Endpoint>>() {}.getType();
    HttpResponseEntity res = httpManager.doGet(createEndpointUrl(null, "/_api/endpoint"));

    // because it is not include common-attribute.
    return EntityFactory.createEntity(res.getText(), type);
  }
  @Override
  public BooleanResultEntity createEndpoint(String endpoint, String... databases)
      throws ArangoException {

    // TODO: validate endpoint

    // validate databases
    if (databases != null) {
      for (String db : databases) {
        validateDatabaseName(db, false);
      }
    }

    HttpResponseEntity res =
        httpManager.doPost(
            createEndpointUrl(null, "/_api/endpoint"),
            null,
            EntityFactory.toJsonString(
                new MapBuilder().put("endpoint", endpoint).put("databases", databases).get()));

    return createEntity(res, BooleanResultEntity.class);
  }