swapped api to take a form