Added status mapping and error handling improvements