Fixed DB connections problems: using Connections pool, refactored DB usage

Also removed unused imports