fleshed out get_data_from_db(), added conditional to prevent breaking