public function index() { // Prepare ApiRequestSerialiser::execute($this); ApiAuthenticator::execute($this); // Generate if ($this->status === 200) { $output = array(); $implementerclass = $this->getImplementerClass(); if (!is_null($implementerclass)) { $this->implementer = new $implementerclass(); $method = $this->method; try { $this->implementer->{$method}($this); } catch (Exception $except) { if ($this->status === 200) { $this->setError(array("status" => 500, "dev" => "Error processing request: please check your syntax against the request definition", "user" => "This request could not be processed")); } } } else { if (Director::isDev()) { $this->testOutput(); } } } else { $this->populateErrorResponse(); } // Deliver $this->setStandardHeaders(); $ApiResponse = $this->getResponseSerialiser(); // Hook to allow analytics tracking, external logging, etc $this->extend('updateController', $this); return $ApiResponse->execute($this); }