Greetings! I am going to need more information to be able to diagnose the issues you are seeing. The URL that is returned (which can be modified in most URL API calls using &BU=" should give more information on the actual errors that you are running into.
Another question is regarding the ticket you are using for login (&TK). How are you generating the ticket? It isn't obvious from the sample code you listed. The ticket must be generated from the XML API.
If you are already using the XML API, I would recommend considering changing your integration to take advantage of the benefits the XML API provides.