Added tests to ApiServices

- added tests
- added missing interface
- added method to end a session explicitly