added exceptions and optimized methods
made the pdo params dynamic