gets all necessary data and savs/updates to db