reformat some incoming data
initializing mysql db