clean up and initial addition of backend code