Added and updated testcases for core, Fixed NPE in getEndpoint() method of APICallPrehandlers