changing API and adding GET condition