Generic REST API built with spark and mongodb