Added postgres support and pages controller