I was wondering what is the reason for using APIResult here, it seems to have created lot of type casing in the code.