got rid of error return when given message is too short
refactored function name to be more generic (actually dealing with both requests and responses)