fix build method to return correct json