implemented consumeApi method.