updated tests, support for apiKey definitions