WIP Remove API

Includes changes from PR #1086
Karma tests fail on my laptop
I replaced the old try/catch block to the file, and karma still failed.