Sending the correct HTTP status code