added api security related code.