Add example scripts using API
Add better error message in API