added templates for completed and failed. restructured how package info is saved in database.