Added request object and extended API error