api clean up and stuff