public function rest_api_init() {
		$register = [];
		foreach ( [ 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTION' ] as $method ) {
			$method_name = strtolower( "handle_{$method}" );
			if ( ! method_exists( $this, $method_name ) ) {
				continue;
			}
			$register[] = [
				'methods' => $method,
			    'callback' => [ $this, 'invoke' ],
			    'args'     => $this->get_arguments( $method ),
			    'permission_callback' => [ $this, 'permission_callback' ],
			];
		}
		if ( ! $register ) {
			throw new \Exception( sprintf( 'Class %s has no handler.', get_called_class() ), 500 );
		} else {
			register_rest_route( $this->namespace, $this->get_route(), $register );
		}
	}