Added code to handle api page