Change used hooks and use package object instead of dict.

Add access_application_URL to package object. Fix error handling
Some manual merging.