class GetHead implements Handler {

  @OpenApi(
      path = ROUTE,
      method = HttpMethod.GET,
      summary = "Get information about the chain head.",
      tags = {TAG_BEACON},
      description =
          "Returns information about the head of the beacon chain from the node’s perspective.\n\n"
              + "To retrieve finalized and justified information, use "
              + GetChainHead.ROUTE
              + " instead.",
      responses = {
        @OpenApiResponse(status = RES_OK, content = @OpenApiContent(from = BeaconHead.class)),
        @OpenApiResponse(status = RES_NO_CONTENT, description = NO_CONTENT_PRE_GENESIS),
        @OpenApiResponse(status = RES_INTERNAL_ERROR)
      })
  @Override
  public void handle(Context ctx) throws Exception {
    ctx.header(CACHE_CONTROL, CACHE_NONE);
    final Optional<BeaconHead> result = provider.getBeaconHead();
    if (result.isPresent()) {
      ctx.result(jsonProvider.objectToJSON(result.get()));
    } else {
      ctx.status(SC_NO_CONTENT);
    }
  }

  public  GetHead(ChainDataProvider provider, JsonProvider jsonProvider);

}