refactoring
making return rack response object, fixing tests accordingly