modified api controller for blogs