swagger mostly implemented. some cleanup.