Added csv parsing and db writing