cleaned up authenticate and status codes