fixed the formatting and integrated in the api