Why is my custom app API failing?