Adds GraphApi method

Introduces the backend method to handle GraphApi
and refactor the JS method signature.