rest api cleanup
work in progress
working!