Added remaining functionality for saving csv to database and accommodate model changes