refactored form, and added rest resource