API: Removed junk SQL, reusing clause function