Added security check for API