handle server errors
don't call server when input is too long