Added correct http status code to RespondWithError() function