fixes for API v0 and sophisticated error management for v1