added tests and implementation for tryApply and tryCall methods