refactored modules

refactored modules, added response code validation