Add db connection to views and controller