completed the API logic with more notes in basecontroller