// Add the query string onto the end
$call .= $queryString;
$db = new CouchDB($dbName);
//  // DEBUG
// echo "Database: " . $dbName;
// echo "\n";
// echo "API call: " . $apiCall;
// echo "\n";
// echo "Couch call: " . $call;
// echo "\n";
// echo "Query string: " . $query;
// echo "\n";
header("Content-Type: application/json");
if ($req_method == "GET") {
    try {
        $response = $db->send($call);
        echo $response->getBody();
    } catch (Exception $e) {
        header("Status: 404");
        header("Content-Type: text/plain");
    }
} else {
    if ($req_method == "POST") {
        try {
            $response = $db->send($call, "PUT", $putOrPostArgs);
            echo $response->getBody();
        } catch (Exception $e) {
            header("Status: 404");
            header("Content-Type: text/plain");
        }
    } else {