Add before do into tests to dry up code.
refactor methods with json parse in response to dry up code.