Updated API code

Credentials are now passed to the next router