Returns the appropriate http status code