public function getRateLimit()
    {
        $this->start();
        try {
            $this->getUserControl()->checkRateLimit();
            $this->getUserControl()->checkGenericAccess(__FUNCTION__);
            $rateLimit = $this->getUserControl()->getRateLimit();
            if ($rateLimit === null) {
                $result = $this->buildJsonResponse(null);
            } else {
                list($maxRequests, $timeWindow) = $rateLimit;
                $visits = $this->getUserControl()->getVisitsCountFromCurrentIP($timeWindow);
                $result = $this->buildJsonResponse([
                    'maxRequests' => $maxRequests,
                    'timeWindow' => $timeWindow,
                    'currentCounter' => $visits,
                ]);
            }
        } catch (Exception $x) {
            $result = $this->buildErrorResponse($x);
        } catch (Throwable $x) {
            $result = $this->buildErrorResponse($x);
        }

        return $this->finish($result);
    }