Moved PDO connection all the way up to api.php and created constructor injection to controllers.