Adding code for storing and retrieving from mongodb