Moved db logic from controller to ProductDB