add soft delete and fix keygen

this adds 'deleted' to each model to allow us to do soft delete (we should only ever look at objects where deleted = false)

also fixes key generation in Application