/**
  * Returns the error JSON when server
  * is running RESTful requests
  *
  * @param array $error
  * @return string
  */
 private function throwRestException(array $error)
 {
     echo json_encode($error, JSON_UNESCAPED_UNICODE);
     RestServer::terminate();
 }