Changed sql.php to use return json