Created database functions to create/get user and event
Merged with head