Added api security check