Clean up API and add manual_query