Handle POST and PUT requests for graph