More flexible API, added callbacks and basic acl system