fix: replace .fail() by .reject()

Signed-off-by: Thibaud Arnault <thyb@oauth.io>
fix oauthdURL in API object + fix toJson()

Signed-off-by: Thibaud Arnault <thyb@oauth.io>