added api controller with example
fixing variable name issues
merging paths