Skiping CSRF verification as it's an API and fix if condition