moved return codes to an enum
test method added to controller