Db apply

fixed bugs in previous master and added national facility registry database.