added get and post form support and refactored handle functions