validate code and return green/red status