Fix api route error