The JAVA Script API and REST API are for embedding reports in your applications.
As to create reports, so far there's no Programatically way, at this moment, you can either
- Create reports in Power BI Desktop.
- Create reports in Power BI service UI.
You can check this idea Power BI Designer API and vote it up.
By the way, may I know what is your scenario? As using UI to develop a report is straightforward and efficient.