Create a REST API to call flowable engine and api

I need to create an application (may be a REST api) such that i can create a task from the code, that task should be reflected in flowable UI .
At this point I am trying to make flowable-rest and flowable-task pointing to same mysql database as they both have different h2 databases as tasks i create in flowable-rest(localhost:8080/flowable-rest/service/runtime/tasks ) is not visible on flowable UI(http://localhost:8080/flowable-task/workflow/#/tasks) .So i am stuck at this. My next step would be to create a REST api to create flowable tasks and get that reflected on UI.
Can I do this by calling flowable-rest in my REST api or any other way?
I need a sample code for the same
It would be really helpful if someone could guide.

Thanks in advance

@shweta i am also stuck with this but i want to admin instead of task so did you found any solution. If Yes can you share it with me. It would be very helpful.
thanks in advance