Add logic layer

Add logic module file, reade for database connection now