adding cache and database interaction layer