Fixing api endpoint