Move the validateSignature method out of the API class.