SQL and data layer finished