Getting you are not authorised message on API