Trying to get the keys for the payload
Refactoring some of the functions to the angular app