Updated cloud functions to work with parse relations in events