this is the flow I am trying to accomplish:
Form completed -> Data Sent to PHP File With Data -> PHP File Takes Data, Queries API -> PHP File Then Returns Query Results back to Original Page as an echo. 
The round trip time for this should be around 10 seconds. Here is my form, AJAX, and PHP file. 
Form
<form id="query_form">
    <input type="text" id="query_input" name="query_input"  required>
    <button id="send_btn" type="submit" name="send_query" value="Submit Request">
</form>
AJAX
<script type="text/javascript">
$(document).on("click", "button[id='send_btn']", function(e){ 
    e.preventDefault(); // Prevents any default actions by clicking submit in a form.
    var query = $("#query_input").val(); // Gets the value of an input
    $.ajax({
                type: "POST",
                url: "run.php",
                data: {query:query},
                success: function(r){ alert(r); }
            });
});
</script>
PHP
<?php
require('RestClient.php');
$term = "";
    if(isset($_POST['query'])){
        $term = $_POST['query']
        try {
        $client = new RestClient('https://api.dataforseo.com/', null, '#########', '###########');
        $post_array = array("language" => "en","key" => $term); // This is the term to search, correct?
        $sv_post_result = $client->post('v2/kwrd_sv', array('data' => $post_array));
        $search_volume = $sv_post_result["results"][0]['sv'];
         echo "<div id='results_div'>
            <table id='results_table'>
                <tr class='results_table_row'>
                    <td id='SEO_Search_Volume_Cell'>
                       $search_volume <span>Approximate Number Of Searches Per Month</span>
                    </td>
                </tr>
            </table>
       </div>";
    } catch (RestClientException $e) {
        echo "\n";
        print "HTTP code: {$e->getHttpCode()}\n";
        print "Error code: {$e->getCode()}\n";
        print "Message: {$e->getMessage()}\n";
        print  $e->getTraceAsString();
        echo "\n";
        echo "An Error Has Occured, Please Try Again Later";
        exit();
        }
    }
?>
Obviously the data echo'd back needs to appear on the same page as the form, yet nothing comes back. Why would this be? 
 
    