Return proper status code