Assigning beacon id to user and event.
remembering beacon id
added cache policy
refactoring
Error handling