Strip whitespaces in teacher input in the API