Added local DB functionality for persisting data.