broke up functions into submitAction handleSuccess and handleFailure in form component to make it more modular to write subclasses