fix several issues. create form API