fix api version handling
improve error handling