Feature/deleteing apis unlinks keys

@stuartquin, there were bugs which meant when APIs or KEYs were deleted they would leave links about to things which officially they aren't still members.