Fix require key in API
Improve error messages for CLI