SparkRestApi refactor