Return correct status code