Trim input from API