Tests (and some improvements) in API key management UI