defining event and callback schemas, closes #367 #368