changed storage method to use JSON format and MongoDB