rearranging, adding API functionality back in