added 501 response for invalid commands