add bad request error handling for unit conversion