Inserts all data into db correctly