up($hesk_settings); } elseif ($request['direction'] === 'down') { $migration->down($hesk_settings); } else { output(array("message" => "Invalid direction provided"), 400); } function output($data, $response = 200, $header = "Content-Type: application/json") { http_response_code($response); header($header); print json_encode($data); }