added the protocal and split up the api call into two methods called by the action button