Code cleanup

- Used concrete types instead of var
- Added Assert.Fail() in tests expecting exceptions
- Added Test-APIKey to test application