Quality Assurance Projects - Metric-Imperial Converter

What is your hint or solution suggestion?

You should return the string ‘invalid unit’ !!!,
not json {error: ‘invalid unit’} as in the example.

Challenge: Metric-Imperial Converter

Link to the challenge: