implemented first pass of REST API and basic tests