Http endpoint for query result

Added http endpoint to download query result as file.