API to simulate a simple calculator on javascript