added api security check