name; if (!$data) { http_response_code(400); } else { try { if (Outfit::CreateOutfit($name, $user->id)) { $createoutfit = "Outfit Created"; } } catch (Exception $e) { $createoutfit = $e->getMessage(); } header('Content-Type: application/json'); echo json_encode(array("alert" => $createoutfit)); }